Translation Strings Status

Hi, Rushabh, how are you?

Rushabh, a long time ago, I and you had started a discussion on Github about the condition of the translation strings on frappe (wnframework) and ERPNext projects.


We had reached an agreement in which the translation strings need for standardization, mainly due to the problems of interpolation and the addition of strings, because in other languages it can not have agreed with the English language.


In this regard, as we are? Any suggestions? Help?

--

Best Regards.

Maxwell Morais
Python Developer powered by Webnotes framework <3
+55 11 954329659




Note:

 

If you are posting an issue,

  1. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.

     

    End of Note



    You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.

    To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/CABK1YkNncEQbnkriZy3Ba–2oyW3w3ukPiv4fQS%3Do1VE-0L6AA%40mail.gmail.com.

    For more options, visit https://groups.google.com/d/optout.

Hi Max,

Thanks for keeping us on our toes :)

We will have to change the old style msgprints:

_("Hello %s. How are you?") % ("Max",)

to new style:

_("Hello {_user}. How are you?").format(_user="Max")

As per this stackoverflow conversation and my test on google translate, google does not replace {_user} since it begins with an underscore which is not part of any langauge :D

It would be pretty easy to do this for server side code and will definitely enhance the multilingual translations.

For javascript strings, we might have to use Mustache instead of our repl() method.

body{font-family:Helvetica,Arial;font-size:13px}body { font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; padding:1em; margin:auto; background:#fefefe; }

h1, h2, h3, h4, h5, h6 {
font-weight: bold;
}

h1 {
color: #000000;
font-size: 28pt;
}

h2 {
border-bottom: 1px solid #CCCCCC;
color: #000000;
font-size: 24px;
}

h3 {
font-size: 18px;
}

h4 {
font-size: 16px;
}

h5 {
font-size: 14px;
}

h6 {
color: #777777;
background-color: inherit;
font-size: 14px;
}

hr {
height: 0.2em;
border: 0;
color: #CCCCCC;
background-color: #CCCCCC;
}

p, blockquote, ul, ol, dl, li, table, pre {
margin: 15px 0;
}

a, a:visited {
color: #4183C4;
background-color: inherit;
text-decoration: none;
}

#message {
border-radius: 6px;
border: 1px solid #ccc;
display:block;
width:100%;
height:60px;
margin:6px 0px;
}

button, #ws {
font-size: 12 pt;
padding: 4px 6px;
border-radius: 5px;
border: 1px solid #bbb;
background-color: #eee;
}

code, pre, #ws, #message {
font-family: Monaco;
font-size: 10pt;
border-radius: 3px;
background-color: #F8F8F8;
color: inherit;
}

code {
border: 1px solid #EAEAEA;
margin: 0 2px;
padding: 0 5px;
}

pre {
border: 1px solid #CCCCCC;
overflow: auto;
padding: 4px 8px;
}

pre > code {
border: 0;
margin: 0;
padding: 0;
}

#ws { background-color: #f8f8f8; }

table {
border-collapse: collapse;
font-family: Helvetica, arial, freesans, clean, sans-serif;
color: rgb(51, 51, 51);
font-size: 15px; line-height: 25px;
padding: 0; }

table tr {
border-top: 1px solid #cccccc;
background-color: white;
margin: 0;
padding: 0; }

table tr:nth-child(2n) {
background-color: #f8f8f8; }

table tr th {
font-weight: bold;
border: 1px solid #cccccc;
margin: 0;
padding: 6px 13px; }

table tr td {
border: 1px solid #cccccc;
margin: 0;
padding: 6px 13px; }

table tr th :first-child, table tr td :first-child {
margin-top: 0; }

table tr th :last-child, table tr td :last-child {
margin-bottom: 0; }

.send { color:#77bb77; }
.server { color:#7799bb; }
.error { color:#AA0000; }


Thanks,
Anand Doshi.

On 2 April 2014 at 6:56:22 am, Maxwell Morais (ma…@gmail.com) wrote:

Hi, Rushabh, how are you?

Rushabh, a long time ago, I and you had started a discussion on Github about the condition of the translation strings on frappe (wnframework) and ERPNext projects.

We had reached an agreement in which the translation strings need for standardization, mainly due to the problems of interpolation and the addition of strings, because in other languages it can not have agreed with the English language. 

In this regard, as we are? Any suggestions? Help?

--

Best Regards.

Maxwell Morais
Python Developer powered by Webnotes framework <3
+55 11 954329659

--
Note:
 
If you are posting an issue,
1. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
3. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.
 
End of Note
---
You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un...@googlegroups.com.

To view this discussion on the web visit
https://groups.google.com/d/msgid/erpnext-developer-forum/CABK1YkNncEQbnkriZy3Ba–2oyW3w3ukPiv4fQS%3Do1VE-0L6AA%40mail.gmail.com
.

For more options, visit https://groups.google.com/d/optout.



Note:

 

If you are posting an issue,

  1. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.

     

    End of Note



    You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.

    To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/etPan.533b8590.74b0dc51.189%40apdmacbook.local.

    For more options, visit https://groups.google.com/d/optout.
Max,

If you have good suggestions, please go ahead and send a PR!

I think the backend system is quite good now, (to memcache everything) - the way we define strings surely needs to be improved.

best,
Rushabh

On Wednesday, April 2, 2014 6:56:01 AM UTC+5:30, Maxwell wrote:
Hi, Rushabh, how are you?

Rushabh, a long time ago, I and you had started a discussion on Github about the condition of the translation strings on frappe (wnframework) and ERPNext projects.


We had reached an agreement in which the translation strings need for standardization, mainly due to the problems of interpolation and the addition of strings, because in other languages it can not have agreed with the English language. 


In this regard, as we are? Any suggestions? Help?

--

Best Regards.

Maxwell Morais
Python Developer powered by Webnotes framework <3
+55 11 954329659




Note:

 

If you are posting an issue,

  1. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.

     

    End of Note



    You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.

    To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/a5770185-aedb-4b7a-8ce8-7b00aff24b6c%40googlegroups.com.

    For more options, visit https://groups.google.com/d/optout.

Max,

My tests were incomplete. Just checked that curlys do not translate well for some languages like German.

The other option would be to use Hello {0} instead of Hello {_user}. {0}, {1} system seems to play well with google translate, but it wouldn’t be very maintainable in the long run.

Need to dig this further.

body{font-family:Helvetica,Arial;font-size:13px}body { font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; padding:1em; margin:auto; background:#fefefe; }

h1, h2, h3, h4, h5, h6 {
font-weight: bold;
}

h1 {
color: #000000;
font-size: 28pt;
}

h2 {
border-bottom: 1px solid #CCCCCC;
color: #000000;
font-size: 24px;
}

h3 {
font-size: 18px;
}

h4 {
font-size: 16px;
}

h5 {
font-size: 14px;
}

h6 {
color: #777777;
background-color: inherit;
font-size: 14px;
}

hr {
height: 0.2em;
border: 0;
color: #CCCCCC;
background-color: #CCCCCC;
}

p, blockquote, ul, ol, dl, li, table, pre {
margin: 15px 0;
}

a, a:visited {
color: #4183C4;
background-color: inherit;
text-decoration: none;
}

#message {
border-radius: 6px;
border: 1px solid #ccc;
display:block;
width:100%;
height:60px;
margin:6px 0px;
}

button, #ws {
font-size: 12 pt;
padding: 4px 6px;
border-radius: 5px;
border: 1px solid #bbb;
background-color: #eee;
}

code, pre, #ws, #message {
font-family: Monaco;
font-size: 10pt;
border-radius: 3px;
background-color: #F8F8F8;
color: inherit;
}

code {
border: 1px solid #EAEAEA;
margin: 0 2px;
padding: 0 5px;
}

pre {
border: 1px solid #CCCCCC;
overflow: auto;
padding: 4px 8px;
}

pre > code {
border: 0;
margin: 0;
padding: 0;
}

#ws { background-color: #f8f8f8; }

table {
border-collapse: collapse;
font-family: Helvetica, arial, freesans, clean, sans-serif;
color: rgb(51, 51, 51);
font-size: 15px; line-height: 25px;
padding: 0; }

table tr {
border-top: 1px solid #cccccc;
background-color: white;
margin: 0;
padding: 0; }

table tr:nth-child(2n) {
background-color: #f8f8f8; }

table tr th {
font-weight: bold;
border: 1px solid #cccccc;
margin: 0;
padding: 6px 13px; }

table tr td {
border: 1px solid #cccccc;
margin: 0;
padding: 6px 13px; }

table tr th :first-child, table tr td :first-child {
margin-top: 0; }

table tr th :last-child, table tr td :last-child {
margin-bottom: 0; }

.send { color:#77bb77; }
.server { color:#7799bb; }
.error { color:#AA0000; }


Thanks,
Anand Doshi.

On 3 April 2014 at 11:11:37 am, rushabh (rm…@gmail.com) wrote:

Max,

If you have good suggestions, please go ahead and send a PR!

I think the backend system is quite good now, (to memcache everything) - the way we define strings surely needs to be improved.

best,
Rushabh

On Wednesday, April 2, 2014 6:56:01 AM UTC+5:30, Maxwell wrote:
Hi, Rushabh, how are you?

Rushabh, a long time ago, I and you had started a discussion on Github about the condition of the translation strings on frappe (wnframework) and ERPNext projects.

We had reached an agreement in which the translation strings need for standardization, mainly due to the problems of interpolation and the addition of strings, because in other languages it can not have agreed with the English language. 

In this regard, as we are? Any suggestions? Help?

--

Best Regards.

Maxwell Morais
Python Developer powered by Webnotes framework <3
+55 11 954329659

--
Note:
 
If you are posting an issue,
1. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
3. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.
 
End of Note
---
You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un...@googlegroups.com.

To view this discussion on the web visit
https://groups.google.com/d/msgid/erpnext-developer-forum/a5770185-aedb-4b7a-8ce8-7b00aff24b6c%40googlegroups.com
.

For more options, visit https://groups.google.com/d/optout.



Note:

 

If you are posting an issue,

  1. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.

     

    End of Note



    You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.

    To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/etPan.533d0123.1190cde7.189%40apdmacbook.local.

    For more options, visit https://groups.google.com/d/optout.

Anand, would not it be better to treat only the automatic translations in a different way?

A simple function that before moving to the google translation service, replacing tags by indices can be created, and when you receive the translated text reinstates brands in the translated text?

eg:


import re
parse_in = re.compile("(\{\_[a-zA-Z]+\})+")

def prepare_to_translate(string):

return (prepared, {0: "_person", 1: "_ask"})

def prepare_from_translate(string, replaces):
string.replace("{", "{{").replace("}", "}}").format(replaces)

def gtranslate(string, language):
marks = None
if parse_in.match(string):
string, marks = prepare_to_transalte(string)
translated = translate_api(string, language)
if marks:
translated = prepare_from_translate(translated, marks)
return translated



2014-04-03 3:35 GMT-03:00 Anand Doshi <an...@erpnext.com>:

Max,

My tests were incomplete. Just checked that curlys do not translate well for some languages like German.

The other option would be to use Hello {0} instead of Hello {_user}. {0}, {1} system seems to play well with google translate, but it wouldn’t be very maintainable in the long run.

Need to dig this further.


Thanks,

Anand Doshi.


On 3 April 2014 at 11:11:37 am, rushabh (rm…@gmail.com) wrote:

Max,

If you have good suggestions, please go ahead and send a PR!

I think the backend system is quite good now, (to memcache everything) - the way we define strings surely needs to be improved.

best,
Rushabh

On Wednesday, April 2, 2014 6:56:01 AM UTC+5:30, Maxwell wrote:
Hi, Rushabh, how are you?

Rushabh, a long time ago, I and you had started a discussion on Github about the condition of the translation strings on frappe (wnframework) and ERPNext projects.

We had reached an agreement in which the translation strings need for standardization, mainly due to the problems of interpolation and the addition of strings, because in other languages it can not have agreed with the English language.

In this regard, as we are? Any suggestions? Help?

--

Best Regards.

Maxwell Morais
Python Developer powered by Webnotes framework <3
--
Note:

If you are posting an issue,
1. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
3. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.

End of Note
---
You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un...@googlegroups.com.

To view this discussion on the web visit
https://groups.google.com/d/msgid/erpnext-developer-forum/a5770185-aedb-4b7a-8ce8-7b00aff24b6c%40googlegroups.com
.

For more options, visit https://groups.google.com/d/optout.



Note:



If you are posting an issue,

  1. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.



    End of Note



    You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.

    To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un…@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/etPan.533d0123.1190cde7.189%40apdmacbook.local.

For more options, visit https://groups.google.com/d/optout.



--

Best Regards.

Maxwell Morais
Python Developer powered by Webnotes framework <3
+55 11 954329659




Note:

 

If you are posting an issue,

  1. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.

     

    End of Note



    You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.

    To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/CABK1YkPe9smKGQycycxKkTXqkXTrW6wU_nUM2gsnufBZvObNkg%40mail.gmail.com.

    For more options, visit https://groups.google.com/d/optout.
Indeed, thats a very good solution, converting the string before it is send to the google translate, and convert the strings back after the translation.

with this we can acheive the better translations by merging the strings into one string ,rather than doing the concatenations.

On Thursday, 3 April 2014 16:55:20 UTC+3, Maxwell wrote:

Anand, would not it be better to treat only the automatic translations in a different way?

A simple function that before moving to the google translation service, replacing tags by indices can be created, and when you receive the translated text reinstates brands in the translated text?

eg:


import re
parse_in = re.compile("(\{\_[a-zA-Z]+\})+")

def prepare_to_translate(string):

return (prepared, {0: “_person”, 1: “_ask”})

def prepare_from_translate(string, replaces):
string.replace(“{”, “{{”).replace(“}”, “}}”).format(replaces)

def gtranslate(string, language):
marks = None
if parse_in.match(string):
string, marks = prepare_to_transalte(string)
translated = translate_api(string, language)
if marks:
translated = prepare_from_translate(translated, marks)
return translated



2014-04-03 3:35 GMT-03:00 Anand Doshi <an...@erpnext.com>:

Max,

My tests were incomplete. Just checked that curlys do not translate well for some languages like German.

The other option would be to use Hello {0} instead of Hello {_user}. {0}, {1} system seems to play well with google translate, but it wouldn’t be very maintainable in the long run.

Need to dig this further.


Thanks,

Anand Doshi.


On 3 April 2014 at 11:11:37 am, rushabh (rm…@gmail.com) wrote:

Max,

If you have good suggestions, please go ahead and send a PR!

I think the backend system is quite good now, (to memcache everything) - the way we define strings surely needs to be improved.

best,
Rushabh

On Wednesday, April 2, 2014 6:56:01 AM UTC+5:30, Maxwell wrote:
Hi, Rushabh, how are you?

Rushabh, a long time ago, I and you had started a discussion on Github about the condition of the translation strings on frappe (wnframework) and ERPNext projects.

We had reached an agreement in which the translation strings need for standardization, mainly due to the problems of interpolation and the addition of strings, because in other languages it can not have agreed with the English language. 

In this regard, as we are? Any suggestions? Help?

--

Best Regards.

Maxwell Morais
Python Developer powered by Webnotes framework <3
--
Note:
 
If you are posting an issue,
1. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
3. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.
 
End of Note
---
You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un...@googlegroups.com.

To view this discussion on the web visit
https://groups.google.com/d/msgid/erpnext-developer-forum/a5770185-aedb-4b7a-8ce8-7b00aff24b6c%40googlegroups.com
.

For more options, visit https://groups.google.com/d/optout.



Note:

 

If you are posting an issue,

  1. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.

     

    End of Note



    You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.

    To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un…@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/etPan.533d0123.1190cde7.189%40apdmacbook.local.

For more options, visit https://groups.google.com/d/optout.



--

Best Regards.

Maxwell Morais
Python Developer powered by Webnotes framework <3
+55 11 954329659




Note:

 

If you are posting an issue,

  1. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.

     

    End of Note



    You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.

    To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/f699ae8d-783c-4826-9e9e-04e67b2d338b%40googlegroups.com.

    For more options, visit https://groups.google.com/d/optout.

Yes. Even I thought this should work. But for 3 languages: Hebrew, Urdu and Latin.

body{font-family:Helvetica,Arial;font-size:13px}body { font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; padding:1em; margin:auto; background:#fefefe; }

h1, h2, h3, h4, h5, h6 {
font-weight: bold;
}

h1 {
color: #000000;
font-size: 28pt;
}

h2 {
border-bottom: 1px solid #CCCCCC;
color: #000000;
font-size: 24px;
}

h3 {
font-size: 18px;
}

h4 {
font-size: 16px;
}

h5 {
font-size: 14px;
}

h6 {
color: #777777;
background-color: inherit;
font-size: 14px;
}

hr {
height: 0.2em;
border: 0;
color: #CCCCCC;
background-color: #CCCCCC;
}

p, blockquote, ul, ol, dl, li, table, pre {
margin: 15px 0;
}

a, a:visited {
color: #4183C4;
background-color: inherit;
text-decoration: none;
}

#message {
border-radius: 6px;
border: 1px solid #ccc;
display:block;
width:100%;
height:60px;
margin:6px 0px;
}

button, #ws {
font-size: 12 pt;
padding: 4px 6px;
border-radius: 5px;
border: 1px solid #bbb;
background-color: #eee;
}

code, pre, #ws, #message {
font-family: Monaco;
font-size: 10pt;
border-radius: 3px;
background-color: #F8F8F8;
color: inherit;
}

code {
border: 1px solid #EAEAEA;
margin: 0 2px;
padding: 0 5px;
}

pre {
border: 1px solid #CCCCCC;
overflow: auto;
padding: 4px 8px;
}

pre > code {
border: 0;
margin: 0;
padding: 0;
}

#ws { background-color: #f8f8f8; }

table {
border-collapse: collapse;
font-family: Helvetica, arial, freesans, clean, sans-serif;
color: rgb(51, 51, 51);
font-size: 15px; line-height: 25px;
padding: 0; }

table tr {
border-top: 1px solid #cccccc;
background-color: white;
margin: 0;
padding: 0; }

table tr:nth-child(2n) {
background-color: #f8f8f8; }

table tr th {
font-weight: bold;
border: 1px solid #cccccc;
margin: 0;
padding: 6px 13px; }

table tr td {
border: 1px solid #cccccc;
margin: 0;
padding: 6px 13px; }

table tr th :first-child, table tr td :first-child {
margin-top: 0; }

table tr th :last-child, table tr td :last-child {
margin-bottom: 0; }

.send { color:#77bb77; }
.server { color:#7799bb; }
.error { color:#AA0000; }


Thanks,
Anand Doshi.

On 5 April 2014 at 2:37:57 pm, Syed Qadeer (sd…@gmail.com) wrote:

Indeed, thats a very good solution, converting the string before it is send to the google translate, and convert the strings back after the translation.

with this we can acheive the better translations by merging the strings into one string ,rather than doing the concatenations.

On Thursday, 3 April 2014 16:55:20 UTC+3, Maxwell wrote:

Anand, would not it be better to treat only the automatic translations in a different way?
A simple function that before moving to the google translation service, replacing tags by indices can be created, and when you receive the translated text reinstates brands in the translated text?

eg:


import re
parse_in = re.compile("(\{\_[a-zA-Z]+\})+")

def prepare_to_translate(string):

return (prepared, {0: “_person”, 1: “_ask”})

def prepare_from_translate(string, replaces):
string.replace(“{”, “{{”).replace(“}”, “}}”).format(replaces)

def gtranslate(string, language):
marks = None
if parse_in.match(string):
string, marks = prepare_to_transalte(string)
translated = translate_api(string, language)
if marks:
translated = prepare_from_translate(translated, marks)
return translated



2014-04-03 3:35 GMT-03:00 Anand Doshi <an...@erpnext.com>:

Max,

My tests were incomplete. Just checked that curlys do not translate well for some languages like German.

The other option would be to use Hello {0} instead of Hello {_user}. {0}, {1} system seems to play well with google translate, but it wouldn’t be very maintainable in the long run.

Need to dig this further.


Thanks,
Anand Doshi.

On 3 April 2014 at 11:11:37 am, rushabh (rm...@gmail.com) wrote:

Max,

If you have good suggestions, please go ahead and send a PR!

I think the backend system is quite good now, (to memcache everything) - the way we define strings surely needs to be improved.

best,
Rushabh

On Wednesday, April 2, 2014 6:56:01 AM UTC+5:30, Maxwell wrote:
Hi, Rushabh, how are you?

Rushabh, a long time ago, I and you had started a discussion on Github about the condition of the translation strings on frappe (wnframework) and ERPNext projects.

We had reached an agreement in which the translation strings need for standardization, mainly due to the problems of interpolation and the addition of strings, because in other languages it can not have agreed with the English language. 

In this regard, as we are? Any suggestions? Help?

--

Best Regards.

Maxwell Morais
Python Developer powered by Webnotes framework <3
--
Note:
 
If you are posting an issue,
1. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
3. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.
 
End of Note
---
You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un...@googlegroups.com.

To view this discussion on the web visit
https://groups.google.com/d/msgid/erpnext-developer-forum/a5770185-aedb-4b7a-8ce8-7b00aff24b6c%40googlegroups.com
.

For more options, visit https://groups.google.com/d/optout.

--
Note:
 
If you are posting an issue,
1. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
3. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.
 
End of Note
---
You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/etPan.533d0123.1190cde7.189%40apdmacbook.local.

For more options, visit https://groups.google.com/d/optout.



--

Best Regards.

Maxwell Morais
Python Developer powered by Webnotes framework <3
+55 11 954329659

--
Note:
 
If you are posting an issue,
1. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
3. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.
 
End of Note
---
You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un...@googlegroups.com.

To view this discussion on the web visit
https://groups.google.com/d/msgid/erpnext-developer-forum/f699ae8d-783c-4826-9e9e-04e67b2d338b%40googlegroups.com
.

For more options, visit https://groups.google.com/d/optout.



Note:

 

If you are posting an issue,

  1. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.

     

    End of Note



    You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.

    To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/etPan.5340fe83.507ed7ab.1e2%40apdmacbook.local.

    For more options, visit https://groups.google.com/d/optout.