We have moved to a new Sailfish OS Forum. Please start new discussions there.
12

How to migrate translation strings from transifex to translate.sailfishos.org ?

asked 2016-05-13 15:14:46 +0200

sledges gravatar image

updated 2016-06-03 14:05:57 +0200

We got loads of the great translations already done by our community in:

How could we import all those to the Pootle translation tool that Jolla has just rolled out in https://translate.sailfishos.org ?

If transifex can export .ts files, that would be great, but would still need some sort of arbitration for those strings?

I'm not aware of how transifex works, but I do know Pootle.

If I could import them to Pootle with a script (matching string IDs), they would appear in the tool as readily accepted strings, but not suggestions.

The best however would be to add them as suggestions and then credit the author(s), but this is where my Pootle knowledge ends and more thought needs to be put (I'll look into Pootle's source code as well)

I very much hoping for your input! :)

Cheers!
Sim

PS: At the end of the day, a tedious manual copy/paste would work, but that's just sad isn't it :)

edit retag flag offensive close delete

Comments

1

PS: At the end of the day, a tedious manual copy/paste would work, but that's just sad isn't it :)

Fixed term low pay intership position(s) opening soon on Jolla.com ?)

avhakola ( 2016-05-13 16:08:05 +0200 )edit

Do you have any updates on this? I would love to continue the maintaining the Hungarian translation on the Pootle rather then on the github and it would be more efficient to have the original English strings for translation.

martonmiklos ( 2016-06-23 00:01:43 +0200 )edit

2 Answers

Sort by » oldest newest most voted
0

answered 2016-05-13 19:01:33 +0200

Downloading .ts file from Transifex is possible. String format in the downloaded file is xml, example of context:

<name>AboutPreferences</name>
<message>
    <location filename="../src/ui/qml/AboutPreferences.qml" line="14"/>
    <source>Ricochet %1</source>
    <extracomment>%1 version, e.g. 1.0.0</extracomment>
    <translation>Ricochet %1</translation>
</message>
edit flag offensive delete publish link more

Comments

btw, the example is from https://www.transifex.com/ricochet-im/dashboard/all_resources/fi/

reviewjolla ( 2016-05-13 19:09:35 +0200 )edit
1

It is possible to use transifex commandline client. In fedora it is packaged as transifex-clinet I have a script to create an packge. See https://github.com/jmlich/jolla-cesky/

The commands are:

tx init

tx set --auto-remote https://www.transifex.com/projects/p/jolla-cesky

tx pull -a

xmlich02 ( 2016-05-13 19:17:32 +0200 )edit
0

answered 2016-06-03 20:51:44 +0200

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

updated 2016-06-03 20:51:44 +0200

All the of the currently existing unofficial translations were created by pulling the qm files from the devices and "reverese engineering" them with the qm2ts util. This means that we do not have the original strings, just the source message ID in the ts files.

This is an example how a message in the unofficial translation's TS files look like:

  <TS version="2.0" language="hu_HU">
  <context>
    <name></name>
    <message>
        <source>camera_settings-la-wb-shade</source>
        <translation>Árnyék</translation>
    </message>

  ....

And the same message has the following format in the TS file downloaded from the https://translate.sailfishos.org

  <TS version="2.1" language="fr">
  <context>
     <name></name>
     <message id="camera_settings-la-wb-shade">
         <location filename="../src/settings.qml" line="238"></location>
         <source>Shade</source>
        <extracomment>"Shade white balance"</extracomment>
        <translation>Ombragé</translation>
     </message>

I think it would be pretty straightforward to create a tool to merge the formats together.

edit flag offensive delete publish link more

Comments

@martonmiklos, I've extracted the */templates/* .ts files from current snapshot of pootle (note, the special Terminology project will contain a .pot :)). Mail me to get that tarball.

So the output of the mass-migrator (with some ID matching) tool would be to create an equivalent tree with e.g. */hu/* directory instead (this is the language code for Hungarian in Pootle), add language="hu" to the TS tag, and provide <translation>GOES_HERE</translation> from transifex, and send it back to me. This will be the easiest one-click import to pootle.

Thanks!

sledges ( 2016-08-24 15:53:52 +0200 )edit
Login/Signup to Answer

Question tools

Follow
4 followers

Stats

Asked: 2016-05-13 15:14:46 +0200

Seen: 1,567 times

Last updated: Jun 03 '16