Translate of addon with upstream repo existing

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
takoi Offline
Fan
Posts: 678
Joined: Oct 2009
Reputation: 10
Location: Norway
Post: #16
well this appears to be working:

xml2po -o template.pot template.xml
xml2po -p LANG.po -o LANG.xml template.xml
find quote
alanwww1 Offline
Team-XBMC Member
Posts: 1,360
Joined: Nov 2008
Reputation: 33
Location: Hungary
Post: #17
ventech Wrote:well this appears to be working:
xml2po -o template.pot template.xml
xml2po -p LANG.po -o LANG.xml template.xml

You have tried it with sample files ?

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
find quote
takoi Offline
Fan
Posts: 678
Joined: Oct 2009
Reputation: 10
Location: Norway
Post: #18
yes
find quote
alanwww1 Offline
Team-XBMC Member
Posts: 1,360
Joined: Nov 2008
Reputation: 33
Location: Hungary
Post: #19
ventech Wrote:yes

Could you please enclose the sample files, for checking ?

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
find quote
takoi Offline
Fan
Posts: 678
Joined: Oct 2009
Reputation: 10
Location: Norway
Post: #20
template.xml: http://pastebin.com/aYBRg3YN
template.pot: http://pastebin.com/Fx0H8bQp
translation.po: http://pastebin.com/XkdMMixa
translation.xml: http://pastebin.com/cWQKkGAS
find quote
alanwww1 Offline
Team-XBMC Member
Posts: 1,360
Joined: Nov 2008
Reputation: 33
Location: Hungary
Post: #21
Quote:xml2po -o template.pot template.xml
xml2po -p LANG.po -o LANG.xml template.xml

This works really well and easy.

At the end i get back the original xml file format only the translated parts show up as changed strings.

I was even made a test with a modified original xml file. With poedit (but i am sure launchpad also nows this function) i was able to make an update and the changed new strings appeared, the deleted strings disappeared with no problem. At the end i once again got back the correct translated xml file.

The only think to keep things maintained is to create the po template (pot) file from time to time using the current strings.xml files in svn or git and i guess upload to launchpad.

What do you think Spiff ? This could work out.

Can we make a test on xbmc launchpad ?

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
find quote
spiff Offline
Retired Developer
Posts: 12,386
Joined: Nov 2003
Post: #22
this looks promising. i'll discuss with those with the access needed.
find quote
takoi Offline
Fan
Posts: 678
Joined: Oct 2009
Reputation: 10
Location: Norway
Post: #23
alanwww1 Wrote:The only think to keep things maintained is to create the po template (pot) file from time to time using the current strings.xml files in svn or git and i guess upload to launchpad.
actually, launchpad can automatically import from bazaar branches
find quote
alanwww1 Offline
Team-XBMC Member
Posts: 1,360
Joined: Nov 2008
Reputation: 33
Location: Hungary
Post: #24
@Ventech
Thanks for the great suggestion with po2xml ! Big Grin

ventech Wrote:actually, launchpad can automatically import from bazaar branches

But doesn't Launchpad needs po or pot file for direct import ? In this case the developers would always have to keep a po file in their repositories.

Anyway in the worst case the xml files could be converted and moved to launchpad manually by anybody who can undertake this task.

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
(This post was last modified: 2010-07-26 17:30 by alanwww1.)
find quote
spiff Offline
Retired Developer
Posts: 12,386
Joined: Nov 2003
Post: #25
it's not rocket science to script it.
find quote
takoi Offline
Fan
Posts: 678
Joined: Oct 2009
Reputation: 10
Location: Norway
Post: #26
alanwww1 Wrote:But doesn't Launchpad needs po or pot file for direct import ? In this case the developers would always have to keep a po file in their repositories.
either; the person who adds a string also adds it to the .pot file, or you have a script that executes xml2po. i think the latter is the best because then you can export from launchpad too.
this way all files will stays synced. at least in theory..
find quote
alanwww1 Offline
Team-XBMC Member
Posts: 1,360
Joined: Nov 2008
Reputation: 33
Location: Hungary
Post: #27
spiff Wrote:this looks promising. i'll discuss with those with the access needed.

Hi,

Any news on this ?

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
find quote
hudo Offline
Fan
Posts: 544
Joined: Feb 2009
Reputation: 7
Post: #28
Hi, folks!

I'm also interested in a solution that makes everyone's job easier.

On my latest trac ticket with dharma-pre plugins translations, @spiff alerted me about the problem with the upstream versions of some addons. A git patch is cool, but he had to separate my plugins patch between addons with and without upstream version/svn/git... (and because I didn't realized it before, I made is work harder... sorry spiff).

And I agree that it may cause confusion and chaos maintaining a record of what was translated and what wasn't.
I know that apart from confluence and xbmc strings, I already translated scrapers and plugins. But because some weren't merged, my records are somewhat confusing and in need of a git code review to stay updated on work done.

So, in short, I'm all for a centralized translation system/tool/whatever.

One suggestion I read on the forums was an online community translation tool/site with someone responsible for a language (one person per language) to maintain all things tied together and review/approve translations for that language . I can be responsible for pt_PT. AFAIK, I'm the only PT translator for the last 1 1/2 years.

Anyway, I'm gonna continue translating to update dharma as best has I can.

Happy coding.

Cris
find quote
takoi Offline
Fan
Posts: 678
Joined: Oct 2009
Reputation: 10
Location: Norway
Post: #29
Might not be as straight forward as it appeared.
When trying to convert the xml files to po files, you get duplicates

.pot:
Code:
#: en.xml:27(string) en.xml:48(string)
msgid "May"
msgstr ""
.po produced using xml2po -o no.po -r no.xml en.xml
Code:
#: en.xml:27(string) en.xml:48(string)
msgid "May"
msgstr "Mai"

[...]

#: en.xml:27(string) en.xml:48(string)
msgid "May"
msgstr "mai"
and this translation (capital and lowercase 'm') actually makes sense. This is what you get for building a sentence word by word instead of using a single formated string; so there's a lot of work to do.
find quote
jmarshall Offline
Team-XBMC Developer
Posts: 26,181
Joined: Oct 2003
Reputation: 175
Post: #30
Work that we're most grateful for! The weather stuff is nasty as we're converting it token (word) by token (word).

Ideally we shouldn't be trying to translate the weather stuff at all - it's never going to work perfectly as we're always going to be missing some strings.

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


[Image: badge.gif]
find quote