How to add translations to Peerunity

[quote=“Ben, post:30, topic:2203”][quote=“sandakersmann, post:27, topic:2203”]Does someone know how to add this project to https://www.transifex.com/?

Bitcoin currently run translations through this site, and doing translations are super easy. I’m a total GitHub noob, so I can’t help much with this, but I will do the Norwegian translation when Transifex is up and running.[/quote]

I’ve set up a Transifex account for the PeerUnity project, but I’ll have to spend a little bit of time getting acquainted with how it all works. It seems like a pretty cool site, and because we’re an open-source project, from what I can tell, it should be free.[/quote]

Translations are important and we will find a way to make it practical for people with the appropriate language skills to contribute.

I looked into this just a bit and what I noticed was that bitcoin.org, rather than bitcoin the client seems to be using Transifex. It may still be possible to use (I don’t know), but you won’t be able to just copy the bitcoin solution. Here is a thread about its use: https://bitcointalk.org/index.php?topic=349633.0

It may turn out more practical to have translators place pull requests on GitHub. It occurs to me it is possible to do the translations all within the GitHub web interface. Basically:

  1. Get a GitHub account.
  2. Fork the Peerunity repository by navigating to it (https://github.com/Peerunity/Peerunity) and clicking the “Fork” button in the upper right.
  3. In your forked repository navigate to this source code directory containing all the translations: https://github.com/[YourGitHubUsername]/Peerunity/tree/master/src/qt/local. Note that your own url will differ in that [YourGitHubUsername] will be your GitHub username instead. But you can navigate to it by clicking through the source code directories with your mouse.
  4. Pick the language and dialect (country) you wish to translate. For instance, to provide the Canadian version of French, click file bitcoin_fr_CA.ts. If the language and dialect you wish to translate for doesn’t have a file yet, you can create one by making a copy of an existing translation file (such as spanish abbreviated es) and make the appropriate changes in the file name and elements. Do so in this directory: Peerunity/tree/master/src/qt/locale. Next to the path (the third row of info on the page) you will see a plus button that lets you add a file.
  5. The files have an extremely simple and repetitive XML structure that looks like this:


    Delete
    Effacer

    The location filename will give you some indication where the text appears in the Peerunity, which may not be necessary to know. The source is the English to translate and the translation value is the appropriate text for the language and dialect referenced at the end of the file name. When you select a file you can edit it right in your browser by clicking the Edit button. When you are finished add notes at the bottom and click Commit changes. Now the changes are stored on GitHub in your personal version of the code.
  6. To invite us to merge them into the main community copy, within your personal copy that you altered click Pull Requests on the right and then the New Pull Request. At the top you will see the destination on the left and the source on the right like this: Peerunity:master … myGitHubUsername:master. Confirm the Pull Request. Everyone will see the pull request and we will merge it in.

Please try this out and comment on what is confusing or deficient. I will edit the OP accordingly.

is Transifex just for the website translation?
and and? i see https://www.transifex.com/projects/p/bitcoin-wallet/ for the wallet and https://www.transifex.com/projects/p/bitcoinorg/ for the website

[quote=“irritant, post:2, topic:2208”]is Transifex just for the website translation?
and and? i see https://www.transifex.com/projects/p/bitcoin-wallet/ for the wallet and https://www.transifex.com/projects/p/bitcoinorg/ for the website[/quote]

Neither of these links are for the project from which Peerunity is forked (which is quite similar in structure): https://github.com/bitcoin/bitcoin

Here is the description for the bitcoin-wallet link you posted:

Welcome to Bitcoin Wallet, a standalone Bitcoin payment app for your Android device!
The main project is hosted at: https://github.com/schildbach/bitcoin-wallet/
Notes about translating: https://github.com/schildbach/bitcoin-wallet/wiki/Translating

Thank you for the guide. I can make a pull request, but I really think we should try to get Transifex up and running. I added some translations to the Bitcoin client through them, and it was very smooth sailing. I think it is important to have a user friendly solution for translations so people don’t get discouraged to contribute.

Here is the link for the Bitcoin client: https://www.transifex.com/projects/p/bitcoin/

[quote=“sandakersmann, post:4, topic:2208”]Thank you for the guide. I can make a pull request, but I really think we should try to get Transifex up and running. I added some translations to the Bitcoin client through them, and it was very smooth sailing. I think it is important to have a user friendly solution for translations so people don’t get discouraged to contribute.

Here is the link for the Bitcoin client: https://www.transifex.com/projects/p/bitcoin/[/quote]

The link you included is for the bitcoin.org website, which is unrelated (in terms of solution architecture) to the Bitcoin reference client and the Peerunity client.

I have no doubt using Transifex would be much easier for translators than pull requests but the format of the files produced will be incompatible with our needs. We would have to write software to transform the Transifex data into the format we require. I doubt anyone is going to take the time to write that software, so we are left with pull requests as the most viable option for producing translations with the data format our software requires.

Sorry we can’t make it easier.

The link you included is for the bitcoin.org website, which is unrelated (in terms of solution architecture) to the Bitcoin reference client and the Peerunity client.[/quote]

These texts are for the QT client, not the website.

The link you included is for the bitcoin.org website, which is unrelated (in terms of solution architecture) to the Bitcoin reference client and the Peerunity client.[/quote]

These texts are for the QT client, not the website.[/quote]

I have the pleasure of working with sigmike most days and I have learned that he is almost always right.

So, I stand corrected.

So the question now is: how did the Bitcoin community set it up?

The link you included is for the bitcoin.org website, which is unrelated (in terms of solution architecture) to the Bitcoin reference client and the Peerunity client.[/quote]

These texts are for the QT client, not the website.[/quote]

I have the pleasure of working with sigmike most days and I have learned that he is almost always right.

So, I stand corrected.

So the question now is: how did the Bitcoin community set it up?[/quote]

Hi Jordan Lee,

Sigmike is no doubt a special talent :slight_smile:

Also, thanks to both of you for your outstanding recent work enhancing Peercoin/Peershares/Peerunity !

It is a pleasure to see such outstanding intellects as yours communicating without jealousy or ego.

I applaud you both, and I thank you both for your valuable contributions.

NewMoneyEra

I elaborate what I asked in pull request #38 for a wider audience here:

The qt/locale/*.ts files Peerunity use for translation are inherited from Peercoin 0.4. They are updated using lupdate from the current Peerunity files in pull request #38, which is necessary because new strings have been added with new functions and rebranding. lupdate is used to update the *.ts files. However many terms already translated in Peercoin 0.4 (in the “old” .ts files) have turned untranslated in the new *.ts files.

I see bitcoin v0.9 has already had coincontrol translation. Since we inherit coincontrol from bitcoin, it is logical to inherit its translation, too, so we avoid having different translation for the same term. Now what is the best way to merge the old Peercoin0.4 translation, the new bitcoin0.9 translation into the rebranded Peerunity translation?

Qt Linguist is supposed to be the official tool to edit *.ts files. I haved just played with it. From here it is suggested that lconvert can merge .ts files. But I haven’t found where to download it. I have also looked at diff/merge utilities to see merging the .ts files are easier. There are many tools for merging. There are various issues with this route, e.g. character set supported, diff algorithm unable associate change, interface for merging.

Anyone has thoughts on this?

[quote=“mhps, post:9, topic:2208”]The qt/locale/*.ts files Peerunity use for translation are inherited from Peercoin 0.4. They are updated using lupdate from the current Peerunity files in pull request #38, which is necessary because new strings have been added with new functions and rebranding. lupdate is used to update the *.ts files. However many terms already translated in Peercoin 0.4 (in the “old” .ts files) have turned untranslated in the new *.ts files.

I see bitcoin v0.9 has already had coincontrol translation. Since we inherit coincontrol from bitcoin, it is logical to inherit its translation, too, so we avoid having different translation for the same term. Now what is the best way to merge the old Peercoin0.4 translation, the new bitcoin0.9 translation into the rebranded Peerunity translation?[/quote]

One way to do it is to open several ts files in QtLinguist (it is usually used to translate to several languages at once).

For example, you can open the ts file for the italian translation of Peerunity, and open the ts file for the italian translation of Ppcoin-qt in read-only mode (using the “open” and “open read-only” items in the “File” menu).
This allows you to see the strings that you have to translate for Peerunity and the strings as they were before (in Ppcoin-qt). So you can easily copy/paste/modify the missing strings.

[quote=“glv, post:10, topic:2208”]For example, you can open the ts file for the italian translation of Peerunity, and open the ts file for the italian translation of Ppcoin-qt in read-only mode (using the “open” and “open read-only” items in the “File” menu).
This allows you to see the strings that you have to translate for Peerunity and the strings as they were before (in Ppcoin-qt). So you can easily copy/paste/modify the missing strings.[/quote]

Thanks. I have tried but found many references to ppcoin. For example some of the strings:

Bitcoin address
LOSE ALL OF YOUR PPCOINS
bitcoin-core
QT_TRANSLATE_NOOP("bitcoin-core", "To use the %s option")
rpcuser=ppcoinrpc
....

It seems that rebranding isn’t over yet. I think it’s best to wait until the English version is stable.

For items like that one, I’ve added a new issue on Github so that we can track them in one place.

Thanks Ben. I thought rebranding might not be over so it was more a question about when to start translating. Because currently a generating a new set of *.ts will wipe out many changes. They have to be put back by hand, at least for some of the languages. It’s not trivial work.

Looks like bitcoin has already had a solution that almost covers our needs. https://github.com/bitcoin/bitcoin/blob/master/doc/translation_process.md

It uses Transifex and contributed scripts to manage translation and keep things in sync.

The translators translate on Transifex. A person moves the updated translation to github periodically. It’ s not clear to me what the best way for this to work out with (current) peer4commit is.

Looks like this could be something to add to Peerunity 0.2

Peerunity loaded up in French on my Ubuntu installation, even though the system language is English, think it might’ve been due to Regional Formats settings which was in French. Anyway, I noticed there were three strings still in English in the French version. The same strings are also missing for Norwegian. So I decided to install QT creator and check out QT linguist. It turns out most languages are missing these three strings. They are the following:

In AddressBookPage:
“These are your Peercoin addresses etc…”
In MainOptionsPage:
“Mandatory network transaction etc…”
“Additional network &fee”

The option of adding a fee is always greyed out btw, is that normal?

So if I were to propose translations for these strings, would I have to fork Peerunity, do my changes using QT Linguist, push to my fork then do a pull request?

[quote=“svk, post:15, topic:2208”]Peerunity loaded up in French on my Ubuntu installation, even though the system language is English, think it might’ve been due to Regional Formats settings which was in French. Anyway, I noticed there were three strings still in English in the French version. The same strings are also missing for Norwegian. So I decided to install QT creator and check out QT linguist. It turns out most languages are missing these three strings. They are the following:

In AddressBookPage:
“These are your Peercoin addresses etc…”
In MainOptionsPage:
“Mandatory network transaction etc…”
“Additional network &fee”

The option of adding a fee is always greyed out btw, is that normal?

So if I were to propose translations for these strings, would I have to fork Peerunity, do my changes using QT Linguist, push to my fork then do a pull request?[/quote]

The official wallet of Peercoin, up to current v0.4, has some translation but very spotty. Many locales don’t have translation. For those that have, some only have translation for Bitcoin copied over. If you find English sentences in a locale other than English, it could be due to the source code has changed strings in English and the new text doesn’t have corresponding translation updates. Currently rebranding hasn’t finished completely so it is not surprising that some text dont have translation.

I’m in the process of setting up a continuous integration server.

Our new bot, AutoKrina, is going to help us maintain all of the translations, I just need to figure out how to teach her how to talk to Transifex and watch for modifications.

[quote=“Ben, post:17, topic:2208”]I’m in the process of setting up a continuous integration server.

Our new bot, AutoKrina, is going to help us maintain all of the translations, I just need to figure out how to teach her how to talk to Transifex and watch for modifications.[/quote]
That sounds great. Serious stuff thrown at it. Is there a way to integrate translations with peer4commit.com? Would be great to add some incentives for the translations.

[quote=“Ben, post:17, topic:2208”]I’m in the process of setting up a continuous integration server.

Our new bot, AutoKrina, is going to help us maintain all of the translations, I just need to figure out how to teach her how to talk to Transifex and watch for modifications.[/quote]

That would be great. I would like to keep the current way of translation for Peerunity v0.1 , however, because if transifex is online we will be less concentrated on community testing of v0.1 which is critically important in my opinion. I suspect quite a few small changes will be made soon after v0.1 is released, and some text strings could be changed once the community sees them. It’s more efficient to get the English version right and set before large scale community-based translation effort ensues.