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
About donations (wiki)
Bookstore
Computer Math and Games in Pascal
(preview)
Lazarus Handbook
Search
Advanced search
WIKI Timeout issues
Please read here if you have trouble connecting to the wiki
Recent
Lazarus Portable image fi...
by
CharlyTango
[
Today
at 11:18:49 pm]
TimageList - Lazarus 4 wi...
by
wp
[
Today
at 11:17:32 pm]
Compiler can't find a (fa...
by
tfurnivall
[
Today
at 11:14:22 pm]
What is your favorite "bu...
by
LV
[
Today
at 10:59:36 pm]
Filtering a TStringGrid. ...
by
Nicole
[
Today
at 10:52:34 pm]
Firebird 5.02. - the root...
by
rvk
[
Today
at 10:52:25 pm]
functional IF
by
Warfley
[
Today
at 10:37:12 pm]
Destructing object whose ...
by
AlexanderK
[
Today
at 10:21:06 pm]
Gateway Timeouts
by
creaothceann
[
Today
at 08:50:39 pm]
[SOLVED] macOS/Cocoa - Bl...
by
zeljko
[
Today
at 08:47:22 pm]
Linux - partly off topic...
by
Nicole
[
Today
at 08:40:34 pm]
Replace data in an existi...
by
Roni Wolf
[
Today
at 08:06:41 pm]
[Solved] Access violation...
by
Wilko500
[
Today
at 07:37:29 pm]
InstallAware 2025 Sources...
by
440bx
[
Today
at 07:16:41 pm]
Fast Canvas Library V1.0
by
Gigatron
[
Today
at 06:44:27 pm]
Testers required for LAMW...
by
RayoGlauco
[
Today
at 06:28:40 pm]
FPC 3.2.2 - checksum Erro...
by
paule32
[
Today
at 06:06:55 pm]
Output buffer to audio.
by
Fred vS
[
Today
at 06:00:36 pm]
TProcess freeze
by
LemonParty
[
Today
at 05:47:18 pm]
StringGrid - How to force...
by
etrusco
[
Today
at 05:38:11 pm]
[SOLVED] Speeding up the ...
by
etrusco
[
Today
at 05:28:25 pm]
Layout problem by nested ...
by
Nicole
[
Today
at 05:08:47 pm]
"LCLVersion" in *.lfm fil...
by
zeljko
[
Today
at 04:54:27 pm]
Concole model programming
by
TBMan
[
Today
at 03:50:18 pm]
how to break out early of...
by
creaothceann
[
Today
at 02:39:09 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: Show 'Language-Team' value of po file in application (Read 7232 times)
stem
Jr. Member
Posts: 98
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
Jr. Member
Posts: 98
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: 12850
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
Jr. Member
Posts: 98
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