Lazarus
Home
Help
TinyPortal
Search
Login
Register
Lazarus
»
Forum
»
Miscellaneous
»
Translations
»
Show 'Language-Team' value of po file in application
Free Pascal
Website
Downloads
Wiki
Documentation
Bugtracker
Mailing List
Lazarus
Website
Downloads (Laz+FPC)
Packages (OPM)
FAQ
Wiki
Documentation (RTL/FCL/LCL)
Bugtracker
CCR Bugs
GIT
Mailing List
Other languages
Foundation
Website
Useful Wiki Links
Project Roadmap
Getting the Source
Screenshots
How to use the forum
Forum Rules
About donations (wiki)
Bookstore
Computer Math and Games in Pascal
(preview)
Lazarus Handbook
Search
Advanced search
Recent
Many recent books on Laza...
by
LeP
[
Today
at 10:25:13 am]
Peculiarities in the EXE ...
by
marcov
[
Today
at 09:57:51 am]
Parsing error?
by
cdbc
[
Today
at 09:33:22 am]
Freepascal
by
sh17
[
Today
at 07:44:13 am]
is there PDS reader/expor...
by
Weiss
[
Today
at 07:42:56 am]
Solpage
by
munair
[
Today
at 07:32:48 am]
Isn’t this funny?
by
Joanna
[July 14, 2026, 11:48:50 pm]
Conscious Artificial Inte...
by
schuler
[July 14, 2026, 11:40:27 pm]
Need help with fphttpserv...
by
jamie
[July 14, 2026, 11:38:24 pm]
Lazarus Bugfix Release 4....
by
Martin_fr
[July 14, 2026, 10:55:23 pm]
equivalent to C/C++ "offs...
by
Thaddy
[July 14, 2026, 07:37:23 pm]
LazSWatch - a serial port...
by
CM630
[July 14, 2026, 06:11:52 pm]
MarcoV, please contact. ...
by
jbthiel
[July 14, 2026, 05:35:26 pm]
lazbuild vs IDE: PPU chec...
by
Martin_fr
[July 14, 2026, 05:30:50 pm]
OpenDocument('Filename') ...
by
cdbc
[July 14, 2026, 12:45:35 pm]
TCollection wiki entry
by
Thaddy
[July 14, 2026, 10:56:03 am]
Install new .deb over exi...
by
Thaddy
[July 14, 2026, 07:16:45 am]
I have made some progress...
by
egsuh
[July 14, 2026, 05:36:50 am]
Lazarus Main not building...
by
dbannon
[July 14, 2026, 03:01:32 am]
Lazarus interface to Rexx...
by
mdlueck
[July 13, 2026, 09:52:18 pm]
[SOLVED] WASM import erro...
by
lebao3105
[July 13, 2026, 05:51:47 pm]
Discipline your AI coding...
by
Weiss
[July 13, 2026, 04:37:42 pm]
Hello. I'm new to this co...
by
zeljko
[July 13, 2026, 02:17:38 pm]
weird error message
by
cdbc
[July 13, 2026, 12:23:13 pm]
TTL Record Count, i.e. a ...
by
Zvoni
[July 13, 2026, 09:10:08 am]
« previous
next »
Print
Pages: [
1
]
Author
Topic: Show 'Language-Team' value of po file in application (Read 8032 times)
stem
Full Member
Posts: 101
Show 'Language-Team' value of po file in application
«
on:
December 30, 2018, 11:09:16 pm »
Hi,
with Poedit you can add in the properties a 'Language-Team'. How can I easily show the value of the 'Language-Team' for the currently selected translation in my application? Thank you!
stem
Logged
stem
Full Member
Posts: 101
Re: Show 'Language-Team' value of po file in application
«
Reply #1 on:
May 04, 2019, 09:54:30 pm »
No ideas?
Logged
wp
Hero Member
Posts: 13625
Re: Show 'Language-Team' value of po file in application
«
Reply #2 on:
May 04, 2019, 10:12:54 pm »
In unit "Translations" you can find a class TPoFile which reads the entire file. Property Header contains the name of the last translator and the name of the team. The following code extracts this information from the header:
Code: Pascal
[Select]
[+]
[-]
uses
Translations
;
procedure
ShowTranslationInfo
(
AFileName
:
String
;
out Team
,
Translator
:
String
)
;
var
pofile
:
TPoFile
;
L
:
TStringList
;
i
:
Integer
;
sa
:
TStringArray
;
begin
L
:
=
TStringList
.
Create
;
try
pofile
:
=
TPoFile
.
Create
(
AFileName
)
;
try
L
.
Text
:
=
pofile
.
Header
.
Translation
;
finally
pofile
.
Free
;
end
;
for
i
:
=
0
to
L
.
Count
-
1
do
begin
sa
:
=
L
[
i
]
.
Split
(
':'
)
;
if
(
Length
(
sa
)
=
2
)
then
case
sa
[
0
]
of
'Last-Translator'
:
Translator
:
=
Trim
(
sa
[
1
]
)
;
'Language-Team'
:
Team
:
=
Trim
(
sa
[
1
]
)
;
end
;
end
;
finally
L
.
Free
;
end
;
end
;
Logged
stem
Full Member
Posts: 101
Re: Show 'Language-Team' value of po file in application
«
Reply #3 on:
May 04, 2019, 10:58:18 pm »
Thank you!
Logged
Print
Pages: [
1
]
« previous
next »
Lazarus
»
Forum
»
Miscellaneous
»
Translations
»
Show 'Language-Team' value of po file in application
TinyPortal
© 2005-2018