Error while pulling translations from Transifex


(Egor Lyfar) #1

Sorry, why do I have this error?

ruby: No such file or directory -- script/pull_translations.rb (LoadError)

Russian Translation
(Arpit Jalan) #2

You have to run this command from inside your Discourse folder:

cd path/to/your/discourse_folder
ruby script/pull_translations.rb

(Egor Lyfar) #3

@techAPJ
if I understand well the discourse folder is located in the docker/container? I’am kind of novice in this kind of thing, when I connect to the server and do de dir, I can’t see any folder, than I do cd … and I see the hole server but I am out of the container right?
what is the usual path to the discourse folder?


(Arpit Jalan) #4

Refer this howto to understand Discourse container structure:

In your case look for Host/Container separation and sharing section.


(Egor Lyfar) #5

@techAPJ
ok, i got it, now everything works just well! thank you

except one little thing: from the initial guide of installing the pip the link din’t work for me
https://raw.github.com/pypa/pip/master/contrib/get-pip.py
i replaced it with the link from pip site
https://bootstrap.pypa.io/get-pip.py


(Egor Lyfar) #6

Ok, now when it seems to work, I have a question: How I find the missing string, for example I have several non-translated here:

[ru.filters.new.title.many]
[ru.dates.tiny.about_x_hours.many]
[ru.user.unread_message_count]
[ru.too_few_topics_notice]
[ru.badges.title] 

etc…

I was trying to perform a search on transifex, but it tells me that there are only several untranslated strings, and this is wrong. I don’t get something again here(


(Arpit Jalan) #7

Okay, I just pushed updated files on Transifex. Latest strings should be available there now.


(Egor Lyfar) #8

@techAPJ thanks, but I didn’t find any of my problematic strings there, can we search by the parameter which is shown on the page like this one [ru.dates.tiny.about_x_hours.many]?


(Egor Lyfar) #9

i think that i found missing strings, its ok


(Arpit Jalan) #10

Say for example you want to translate ru.user.unread_message_count, now when you look at English locale file, the string for ru.user.unread_message_count is Messages, so you will search for “Messages” on Transifex:

And you will be able to see relevant Russian string, translate and review the string. Once this process is done, the translated strings are ready to be pulled from Transifex client.

[Note: While I was at Transifex, I added you as Reviewer for Russian team, be sure to mark the strings as reviewed, if they seem correct to you.]


(Egor Lyfar) #11

ok, I wiil translate everything finally i think… tell me, in russian we have this problem with grammatical cases, for example:
if >1 and <4 it is %{count} days ago
if >=5 it is %{count} days(X) ago
where is X different ending for word days

can we use for translation multiple strings like
%{>1count<4} blabla
or list of them?


(Arpit Jalan) #12

Hmm, that’s a typical case. @neil can we add a support for these type of cases?


(Neil Lalonde) #13

For Russian, we currently have pluralization rules configured to support “one”, “few”, “many”, and “other”.

In one example in Transifex, I see some of them, but not “many”:

I don’t know how Transifex knows about those pluralization options and how to add “many”. @Egorussia Is this logic right?

  if ((n % 10) == 1 && (n % 100) != 11) {
    return 'one';
  }
  if ((n % 10) >= 2 && (n % 10) <= 4 &&
      ((n % 100) < 12 || (n % 100) > 14) && n == Math.floor(n)) {
    return 'few';
  }
  if ((n % 10) === 0 || ((n % 10) >= 5 && (n % 10) <= 9) ||
      ((n % 100) >= 11 && (n % 100) <= 14) && n == Math.floor(n)) {
    return 'many';
  }
  return 'other';

Russian Translation
Incorrect time delta on post (Ru interface only)
(Egor Lyfar) #14

yes and no, in russian the logic for “many” continues until the second ten (>= 5 & <=20) and than it follows the logic of few from 21 to 24 and all the ned tens


(Neil Lalonde) #15

You just hurt my brain. I… uh… have no idea.


(Egor Lyfar) #16

lol
if 1,21,31…101… than one
if 2,3,4,…21,22,23,24…31,32,33,34 than few
if 5,6,7,8…20…25,26,27,28,29,30…35,36…than many

i mean that from 11 to 14 the logic is many, not few!


(Egor Lyfar) #17

but now i think that what you wrote previously is correct… sorry i am new in code and all those ((n % 100) are a little bit hard to understand


(Kane York) #18

For reference, n % 10 means the last digit only, and n % 100 means the last two digits only.


(OG) #19

How often are currently translations pulled from Transifex? What is the mechanism?

With every ./launcher rebuild app?