how can i convert a locale file to another language

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

how can i convert a locale file to another language

fugee ohu
All my keys have underscores if not in snake case then at the end  When I copy a file using google translate the colons, quotation marks and white spaces are all invalid yml cause they're not text, they're utf8 Anyone know another translator to use?

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/bbb3812d-9514-4fce-8a0b-f6dda15ac541%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: how can i convert a locale file to another language

Hassan Schroeder-2
On Tue, Jul 10, 2018 at 9:19 AM, fugee ohu <[hidden email]> wrote:
> All my keys have underscores if not in snake case then at the end  When I
> copy a file using google translate the colons, quotation marks and white
> spaces are all invalid yml cause they're not text, they're utf8 Anyone know
> another translator to use?

It would be a pretty sad "internationalization" system that didn't allow
UTF-8 characters, so -- spoiler alert -- there's no problem with UTF-8
in YAML locale files.

Maybe you can explain exactly what issue you're having, with sample
code?

--
Hassan Schroeder ------------------------ [hidden email]
twitter: @hassan
Consulting Availability : Silicon Valley or remote

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CACmC4yAqRNv01Tv8P5Gcu7iP%2BHx79uN4o69TNMSum%3DzR7e7eGw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: how can i convert a locale file to another language

fugee ohu


On Tuesday, July 10, 2018 at 2:12:28 PM UTC-4, Hassan Schroeder wrote:
On Tue, Jul 10, 2018 at 9:19 AM, fugee ohu <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="XXJRnWRaBgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">fuge...@...> wrote:
> All my keys have underscores if not in snake case then at the end  When I
> copy a file using google translate the colons, quotation marks and white
> spaces are all invalid yml cause they're not text, they're utf8 Anyone know
> another translator to use?

It would be a pretty sad "internationalization" system that didn't allow
UTF-8 characters, so -- spoiler alert -- there's no problem with UTF-8
in YAML locale files.

Maybe you can explain exactly what issue you're having, with sample
code?

--
Hassan Schroeder ------------------------ <a href="javascript:" target="_blank" gdf-obfuscated-mailto="XXJRnWRaBgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">hassan.s...@...
twitter: @hassan
Consulting Availability : Silicon Valley or remote

The keys aren't supposed to be utf8 I meant the whole yaml file It doesn't work in google translate, the keys get converted to utf8 along with white space and quotes My question is exactly what I asked 

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/1df26550-d360-4ccd-a60c-17c2f01a6d9e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: how can i convert a locale file to another language

Hassan Schroeder-2
On Thu, Jul 12, 2018 at 8:14 AM, fugee ohu <[hidden email]> wrote:

> The keys aren't supposed to be utf8 I meant the whole yaml file It doesn't
> work in google translate, the keys get converted to utf8 along with white
> space and quotes My question is exactly what I asked

I have no idea what any of that is supposed to mean.

YAML keys can be UTF8.

Any google-translate-provided strings that I've tried work in locale files.

If you can't provide something to demonstrate the actual "problem",
then  ¯\_(ツ)_/¯

--
Hassan Schroeder ------------------------ [hidden email]
twitter: @hassan
Consulting Availability : Silicon Valley or remote

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CACmC4yBdgGhwZiPRnJNp6H-e%2Bkuq-Z1QL644-HGCQJ%2BOMwgfRQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: how can i convert a locale file to another language

fugee ohu


On Thursday, July 12, 2018 at 12:44:50 PM UTC-4, Hassan Schroeder wrote:
On Thu, Jul 12, 2018 at 8:14 AM, fugee ohu <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="R36tmBXYCwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">fuge...@...> wrote:

> The keys aren't supposed to be utf8 I meant the whole yaml file It doesn't
> work in google translate, the keys get converted to utf8 along with white
> space and quotes My question is exactly what I asked

I have no idea what any of that is supposed to mean.

YAML keys can be UTF8.

Any google-translate-provided strings that I've tried work in locale files.

If you can't provide something to demonstrate the actual "problem",
then  ¯\_(ツ)_/¯

--
Hassan Schroeder ------------------------ <a href="javascript:" target="_blank" gdf-obfuscated-mailto="R36tmBXYCwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">hassan.s...@...
twitter: @hassan
Consulting Availability : Silicon Valley or remote

If you copy the entire contents of a yaml  file from translate.google.com it won't be valid yaml for your rails app Whitespaces and quotes that get converted to utf8 are seemingly the cause of the problem 

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/02cb6bee-ed12-4da7-ac49-cc87c5b0eef5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: how can i convert a locale file to another language

fugee ohu
In reply to this post by Hassan Schroeder-2


On Thursday, July 12, 2018 at 12:44:50 PM UTC-4, Hassan Schroeder wrote:
On Thu, Jul 12, 2018 at 8:14 AM, fugee ohu <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="R36tmBXYCwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">fuge...@...> wrote:

> The keys aren't supposed to be utf8 I meant the whole yaml file It doesn't
> work in google translate, the keys get converted to utf8 along with white
> space and quotes My question is exactly what I asked

I have no idea what any of that is supposed to mean.

YAML keys can be UTF8.

Any google-translate-provided strings that I've tried work in locale files.

If you can't provide something to demonstrate the actual "problem",
then  ¯\_(ツ)_/¯

--
Hassan Schroeder ------------------------ <a href="javascript:" target="_blank" gdf-obfuscated-mailto="R36tmBXYCwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">hassan.s...@...
twitter: @hassan
Consulting Availability : Silicon Valley or remote

Just wanna remind you that I asked this question because you can't do it with google translate  

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/a3e2d123-bf30-4424-aca0-ddb316862a7a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: how can i convert a locale file to another language

Brandon McClelland
I would not copy the entire yml file into Translate - it's going to arbitrarily try to translate both keys and values and introduce other artifacts, as you've already witnessed. You will probably get much better results with the extra effort of copying line by line the individual values into Translate; only translating the actual phrase in the Value itself then matching it to the correct key in your new translation yml file. 

It's a pretty standard practice to encode your files with UTF-8. The only reason I came across to not do so is if you're using UTF-16 for primarily Asian language sites. Handling that is probably better asked in a non-English Rails group. Your responses make it sound like you haven't set the default encoding in your text editor or IDE and are getting weird results when Google spits back translations in UTF-8 and you copy the result back into a file.

On Mon, Jul 16, 2018 at 1:54 PM fugee ohu <[hidden email]> wrote:


On Thursday, July 12, 2018 at 12:44:50 PM UTC-4, Hassan Schroeder wrote:
On Thu, Jul 12, 2018 at 8:14 AM, fugee ohu <[hidden email]> wrote:

> The keys aren't supposed to be utf8 I meant the whole yaml file It doesn't
> work in google translate, the keys get converted to utf8 along with white
> space and quotes My question is exactly what I asked

I have no idea what any of that is supposed to mean.

YAML keys can be UTF8.

Any google-translate-provided strings that I've tried work in locale files.

If you can't provide something to demonstrate the actual "problem",
then  ¯\_(ツ)_/¯

--
Hassan Schroeder ------------------------ [hidden email]
twitter: @hassan
Consulting Availability : Silicon Valley or remote

Just wanna remind you that I asked this question because you can't do it with google translate  

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/a3e2d123-bf30-4424-aca0-ddb316862a7a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
Brandon McClelland
User Support Technician
Steve Jackson Games

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CADuEqHL7%3DHukJS5P_Q1di9knuLgzT2K35h02PB_2ez7c5-zTXQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: how can i convert a locale file to another language

fugee ohu


On Monday, July 16, 2018 at 3:46:54 PM UTC-4, Brandon McClelland wrote:
I would not copy the entire yml file into Translate - it's going to arbitrarily try to translate both keys and values and introduce other artifacts, as you've already witnessed. You will probably get much better results with the extra effort of copying line by line the individual values into Translate; only translating the actual phrase in the Value itself then matching it to the correct key in your new translation yml file. 

It's a pretty standard practice to encode your files with UTF-8. The only reason I came across to not do so is if you're using UTF-16 for primarily Asian language sites. Handling that is probably better asked in a non-English Rails group. Your responses make it sound like you haven't set the default encoding in your text editor or IDE and are getting weird results when Google spits back translations in UTF-8 and you copy the result back into a file.

On Mon, Jul 16, 2018 at 1:54 PM fugee ohu <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="q8pQdlccDQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">fuge...@...> wrote:


On Thursday, July 12, 2018 at 12:44:50 PM UTC-4, Hassan Schroeder wrote:
On Thu, Jul 12, 2018 at 8:14 AM, fugee ohu <[hidden email]> wrote:

> The keys aren't supposed to be utf8 I meant the whole yaml file It doesn't
> work in google translate, the keys get converted to utf8 along with white
> space and quotes My question is exactly what I asked

I have no idea what any of that is supposed to mean.

YAML keys can be UTF8.

Any google-translate-provided strings that I've tried work in locale files.

If you can't provide something to demonstrate the actual "problem",
then  ¯\_(ツ)_/¯

--
Hassan Schroeder ------------------------ [hidden email]
twitter: @hassan
Consulting Availability : Silicon Valley or remote

Just wanna remind you that I asked this question because you can't do it with google translate  

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="q8pQdlccDQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">rubyonrails-ta...@googlegroups.com.
To post to this group, send email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="q8pQdlccDQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">rubyonra...@googlegroups.com.
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/rubyonrails-talk/a3e2d123-bf30-4424-aca0-ddb316862a7a%40googlegroups.com?utm_medium=email&amp;utm_source=footer" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/rubyonrails-talk/a3e2d123-bf30-4424-aca0-ddb316862a7a%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/rubyonrails-talk/a3e2d123-bf30-4424-aca0-ddb316862a7a%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/rubyonrails-talk/a3e2d123-bf30-4424-aca0-ddb316862a7a%40googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.


--
Brandon McClelland
User Support Technician
Steve Jackson Games

My editor defaults to utf-8 So you're saying if the whole file was utf-8 it would be ok?

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/0d53c12d-ae1f-4214-8829-a7b6b47fad26%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.