Web-based translations

walterar
Posts: 95
Joined: Sat Sep 14, 2013 4:48 pm

Re: Web-based translations

Post by walterar »

Transifex does not respect the changes?

Is asked:

Code: Select all

   "OVER_N_BILLION" : {
      "description" : "",
      "message" : "Alrededor de %population\b000 millones"
   },
And returns:

Code: Select all

   "OVER_N_BILLION" : {
      "description" : "",
      "message" : "Alrededor de %population\\b000 millones"
   },
robn
Posts: 302
Joined: Mon Jul 01, 2013 1:11 am
Location: Melbourne, Australia

Re: Web-based translations

Post by robn »

Looks like JSON escaping rules. What are you actually trying to achieve, and how are you doing it?
walterar
Posts: 95
Joined: Sat Sep 14, 2013 4:48 pm

Re: Web-based translations

Post by walterar »

Previous - bad
Image

Wanted - correct
Image

joke Transifex :)
Image
robn
Posts: 302
Joined: Mon Jul 01, 2013 1:11 am
Location: Melbourne, Australia

Re: Web-based translations

Post by robn »

What is \b supposed to be?
walterar
Posts: 95
Joined: Sat Sep 14, 2013 4:48 pm

Re: Web-based translations

Post by walterar »

http://en.wikipedia.org/wiki/Control_character

I used them a lot in the past and are still useful.
robn
Posts: 302
Joined: Mon Jul 01, 2013 1:11 am
Location: Melbourne, Australia

Re: Web-based translations

Post by robn »

Pioneer has never supported control codes like that (and I just tested to be really sure). Your screenshot shows that too. Use of JSON and/or Transifex for translations doesn't change this.
walterar
Posts: 95
Joined: Sat Sep 14, 2013 4:48 pm

Re: Web-based translations

Post by walterar »

Json (and Pioneer) does support control characters, in fact is working well and does exactly what I expected to do, as you can see on the screenshot of the medium.

The only problem here is that Transifex, modifies the original.

But do not get problems, if Transifex does not work, i can fix this with a mod.
jpab
Posts: 77
Joined: Thu Jul 18, 2013 12:30 pm
Location: UK

Re: Web-based translations

Post by jpab »

walterar wrote:Json (and Pioneer) does support control characters, in fact is working well and does exactly what I expected to do, as you can see on the screenshot of the medium.
Pioneer has never interpreted control codes in its text rendering. It looks like all you're trying to do is to make sure there's no space character between the %population and 000. You don't need to use control codes to do that, just use "%{population}000".
walterar
Posts: 95
Joined: Sat Sep 14, 2013 4:48 pm

Re: Web-based translations

Post by walterar »

Control characters are widely used in Pioneer, see:

Code: Select all

   "FLAVOUR_0_NONMEMBER_INTRO" : {
      "description" : "",
      "message" : "{clubname} is an independent organisation dedicated to providing discounted starship fuel to its members. Branches can be found throughout the galaxy. Benefits of membership include:\n\n\t* Our own stocks of fuel, independent of the general market\n\t* {hydrogen} at discount prices\n\t* {military_fuel} at discount prices\n\t* {water} at discount prices\n\t* {radioactives}, free disposal (conditions apply)\n\t* Fuel tank refilling, where necessary\n\nJoin now! Annual membership costs only {membership_fee}"
   },
jpab
Posts: 77
Joined: Thu Jul 18, 2013 12:30 pm
Location: UK

Re: Web-based translations

Post by jpab »

walterar wrote:Control characters are widely used in Pioneer
I'm sorry, I should have been more specific. Only the line-feed character ('\n', U+000A) and the NUL ('\0' U+0000) character are interpreted (NUL indicates the end of the string). All other control characters are ignored. You can verify this easily by inserting control characters into a label in the UI. For example, the 'Pioneer' label on the main menu, which is set directly in data/ui/MainMenu.lua (not from a translation file). Change it to "Pio\tn\beer" and see that the control characters have no effect.
Post Reply