enhancement language Success

User tests: Successful: Unsuccessful:

avatar elkuku
elkuku
16 Nov 2013

So this is another thingy I'm offering in the middle of a 1.0 beta release cycle....

Since we already have a somewhat "multilingual experience", it would be good to provide the same functionality to JavaScript files.

The solution proposed here is, as always, highly experimental.

A bower update and composer update are needed.

avatar elkuku elkuku - open - 16 Nov 2013
avatar elkuku elkuku - open - 16 Nov 2013
avatar b2z
b2z - comment - 16 Nov 2013

Looks awesome :)

avatar b2z
b2z - comment - 23 Jan 2014

@elkuku could you plz update it - wanna test it :sunglasses:

avatar elkuku
elkuku - comment - 24 Jan 2014

Easiest test is the preview in our editor (don't forget to clean the cache (as I do always :P )) that should display the translated "Loading preview..." string
OH - don't forget to bower install ;)

avatar b2z
b2z - comment - 30 Jan 2014

So running make langfiles gives me many errors like this:
/vagrant/src/JTracker/g11n/de-DE/de-DE.JTracker.js.po:25:12: invalid multibyte sequence

The same is for RU files.

But the translations are working and that is awesome :sunglasses:

avatar elkuku
elkuku - comment - 31 Jan 2014

Should be fixed - Thanks :wink:

avatar b2z
b2z - comment - 1 Feb 2014

Yeap, fixed. But now there is another problem - files are incorrectly merged after make langfiles:

#: /www/jtracker/core/js/jtracker.js:22
 /www/jtracker/core/js/jtracker.js:43
msgid "Invalid response."
msgstr "Ungültige Antwort"
avatar elkuku
elkuku - comment - 1 Feb 2014

I get this:

#: /www/jtracker/core/js/jtracker.js:22 /www/jtracker/core/js/jtracker.js:43
msgid "Invalid response."
msgstr "Ungültige Antwort"

which isn't very nice either, but at least it's not a syntax error...

Now this looks to me like another line ending thingy - could you verify that the language files have UNIX style \n's ?

I also got the same "issue" here - no idea what could be causing this :(

avatar b2z
b2z - comment - 1 Feb 2014

could you verify that the language files have UNIX style \n's ?

How to verify it?

avatar elkuku
elkuku - comment - 1 Feb 2014

PHPStorm shows it in the status bar (LF, CRLF, or CR)
Another question: How does the pot file look like ? Did you run make langtemplates and did that alter the pot file ?

The last resource that occurs to me is hacking again the output of the command... nobody's perfect - not even Linux :P

avatar b2z
b2z - comment - 2 Feb 2014

So just checked - langfiles and templates are CRLF, but after make langtemplates and then make langfiles those are LF :) BTW I get the same as you:

#: /www/jtracker/core/js/jtracker.js:22 /www/jtracker/core/js/jtracker.js:43
msgid "Invalid response."
msgstr "XYZ...файлы"

But the main thing is that translations are working :+1:

avatar b2z
b2z - comment - 3 Feb 2014

So if the problem above is not a blocker then we could merge this PR.

avatar elkuku
elkuku - comment - 3 Feb 2014

Sorry but I didn't get the solution you found :(

Under what circumstances you get this error result ?
Can we do anything to avoid it ?

avatar b2z
b2z - comment - 3 Feb 2014

Under what circumstances you get this error result result ?

Seems like it was a CRLF problem. After make langtemplates and then make langfiles files become LF and problem disappears. But only this remains:

#: /www/jtracker/core/js/jtracker.js:22 /www/jtracker/core/js/jtracker.js:43
avatar elkuku elkuku - reference | - 3 Feb 14
avatar elkuku
elkuku - comment - 3 Feb 2014

OK that makes it easier... I searched a bit and the gettext utilities definitely have a problem with non UNIX style line endings.
I added a check and those files will be rejected from now when running make langfiles - apologies ;)

The remaining "issue" (multiple files on a single line)- I don't know what to do about it... At least it's not a syntax error and PHPStorm is still able to jump to the correct file:line on Ctrl+CLICK :wink:

avatar b2z
b2z - comment - 4 Feb 2014

Everything is good. As I understand these translation files also will go to the Transifex?

avatar elkuku
elkuku - comment - 4 Feb 2014

Actually only the pot files go to Transifex. I suppose they will handle line endings better than we do ;)

avatar b2z b2z - reference | - 4 Feb 14
avatar b2z b2z - merge - 4 Feb 2014
avatar b2z b2z - close - 4 Feb 2014
avatar b2z
b2z - comment - 4 Feb 2014

BTW I missed it - who deletes the branches: owner or person who merge?

avatar elkuku elkuku - head_ref_deleted - 4 Feb 2014
avatar elkuku
elkuku - comment - 4 Feb 2014

Whoever is first I guess ;)

Add a Comment

Login with GitHub to post a comment