OK. So the framework is updating the languages files in my app based on
translations in other apps (e.g., admin and appadmin)?

But only if a website visitor requests a page in that language, correct?

So I'm imagining the following algorithm:

- website visitor with a 'pl' language preference visits my site
- goes to a page with T("Hello")
- web2py looks for /myapp/languages/pl.py
- web2py looks for "Hello" in that file
- can't find it, so it checks /appadmin/languages/pl.py
- finds a translation in that file
- updates /myapp/languages/pl.py with this translation
- shows visitor the translated text

Is that about right?
On Jan 14, 2016 5:34 PM, "Anthony" <abasta...@gmail.com> wrote:

> web2py comes with many phrases already translated (e.g., those used in
> admin and appadmin):
>
>
> https://github.com/web2py/web2py/blob/master/applications/welcome/languages/ru.py#L13
>
> Anthony
>
> On Thursday, January 14, 2016 at 3:40:47 PM UTC-5, mwolfe02 wrote:
>>
>> That makes sense.  I guess my question is where do the translations
>> themselves come from?  For example, the following two lines were *added* to
>> the Russian translation file:
>>
>> '%s rows deleted': '%s строк удалено',
>> '%s rows updated': '%s строк изменено',
>>
>> I certainly did not add in the Cyrillic characters in the above lines.
>> So where did they come from?
>>
>> There are some lines that were just changed from their hex code to the
>> Unicode characters (e.g., "\xd0\x98\xd0\xb7\xd0\xbc" to "Изм").  That I can
>> understand.  It's the brand new translations that I was surprised by.
>> Could they be coming from the languages files in the example app?
>>
>> Thanks,
>> Mike
>>
>> On Thu, Jan 14, 2016 at 3:32 PM, Anthony <abasta...@gmail.com> wrote:
>>
>>> The first time a visitor requesting a particular language hits the app,
>>> any T() items not yet in the associated translation file will be added
>>> automatically for later translation.
>>>
>>> Anthony
>>>
>>>
>>> On Thursday, January 14, 2016 at 2:41:04 PM UTC-5, mwolfe02 wrote:
>>>>
>>>> I've got a live web2py application under Mercurial version control.
>>>> When I did my latest commit, I noticed there were several changes to the
>>>> following two files (the Polish and Russian translation files):
>>>>
>>>> /languages/pl.py
>>>> /languages/ru-ru.py
>>>>
>>>> I did not make these changes.  The changes look like they could be
>>>> legitimate and perhaps automated.  For example, here are the first few
>>>> lines of the ru-ru.py diff (I removed some characters and replaced them
>>>> with {...} to limit the amount of noise:
>>>>
>>>>
>>>> @@ -1,87 +1,91 @@
>>>> -# coding: utf8
>>>> +# -*- coding: utf-8 -*-
>>>>  {
>>>> -'"update" is an optional expression like "field1=\'newvalue\'". You
>>>> cannot update or delete the results of a JOIN':
>>>> '"\xd0\x98\xd0{...}\xd1\x8c.',
>>>> +'"update" is an optional expression like "field1=\'newvalue\'". You
>>>> cannot update or delete the results of a JOIN': '"Изм{...}ть.',
>>>> +'%s rows deleted': '%s строк удалено',
>>>> +'%s rows updated': '%s строк изменено',
>>>>  '%Y-%m-%d': '%Y-%m-%d',
>>>>  '%Y-%m-%d %H:%M:%S': '%Y-%m-%d %H:%M:%S',
>>>>
>>>>
>>>> So what could have caused these changes?  Does web2py itself do
>>>> something that would cause this?  Google Translate?  Website visitors?
>>>> Apache?
>>>>
>>>> Are there security considerations I should be aware of?
>>>>
>>>> As far as I know, I have not done anything to modify the default
>>>> Translation behavior of my app.
>>>>
>>>> Thanks in advance to anyone who can enlighten me,
>>>> Mike Wolfe
>>>>
>>> --
>>> Resources:
>>> - http://web2py.com
>>> - http://web2py.com/book (Documentation)
>>> - http://github.com/web2py/web2py (Source code)
>>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>>> ---
>>> You received this message because you are subscribed to a topic in the
>>> Google Groups "web2py-users" group.
>>> To unsubscribe from this topic, visit
>>> https://groups.google.com/d/topic/web2py/46XERxrdvts/unsubscribe.
>>> To unsubscribe from this group and all its topics, send an email to
>>> web2py+unsubscr...@googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/web2py/46XERxrdvts/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to