Post by Begetan » Fri Jul 01, 2011 7:35 am

Hello!

I'am working on translation new OpenCart into russian. It's not so hard due to OpenCart's clear MVC design :)

But there is another problem with quite fast development of new versions. Every day а lot of small pieces of code may change, so tranlators has only two options: folow every changes in svn, or wait long time between releases.

I suggest a great idea to improve localization support in OC.
I named it "Language fallback = on".

Here is small description.

For every language teplate we do
1. Load fallback language at first ( i.e. english text from language/english tpl, or language_id==1 from SQL queries)
2. Fill neded PHP Arrays in fallback strings
3. Load current language
4. Override all PHP Arrays with actual strings

In fallback mode we may start our shop with only 10% complete tranllation. Also possible run multilanguage shop with full fresh updates. We will see correct english text Instead of error messages.

Newbie

Posts

Joined
Fri Jul 01, 2011 6:27 am

Post by Qphoria » Sun Jul 03, 2011 3:06 am

Begetan wrote:Hello!

I'am working on translation new OpenCart into russian. It's not so hard due to OpenCart's clear MVC design :)

But there is another problem with quite fast development of new versions. Every day а lot of small pieces of code may change, so tranlators has only two options: folow every changes in svn, or wait long time between releases.

I suggest a great idea to improve localization support in OC.
I named it "Language fallback = on".

Here is small description.

For every language teplate we do
1. Load fallback language at first ( i.e. english text from language/english tpl, or language_id==1 from SQL queries)
2. Fill neded PHP Arrays in fallback strings
3. Load current language
4. Override all PHP Arrays with actual strings

In fallback mode we may start our shop with only 10% complete tranllation. Also possible run multilanguage shop with full fresh updates. We will see correct english text Instead of error messages.
Language fallback has been around since OpenCart 0.x
It was added to the core by me in 0.7.9
It was removed by daniel in 1.x through 1.3.x
Added back into the core by me in 1.4.7 through 1.4.9.x
Removed again by daniel in 1.5.0

Daniel needs to be convinced.

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by Qphoria » Tue Jul 05, 2011 8:25 am


Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by Begetan » Wed Jul 13, 2011 2:00 am

It sounds like a real code war :clown:

Newbie

Posts

Joined
Fri Jul 01, 2011 6:27 am

Post by Johnathan » Sat Jul 23, 2011 6:37 pm

Just realized why not having the language fallback is such a negative thing: any user who installs a module also needs to copy the new English language files to their other languages. Although I don't usually use multiple languages, I can imagine this would be pretty annoying for a user with multiple languages to have to do *every* time they purchase an extension. (Plus, it creates more work for us developers to have to field questions about not having the correct language files.)

Image Image Image Image Image


User avatar
Administrator

Posts

Joined
Fri Dec 18, 2009 3:08 am


Post by Qphoria » Sun Jul 24, 2011 3:11 am

Johnathan wrote:Just realized why not having the language fallback is such a negative thing: any user who installs a module also needs to copy the new English language files to their other languages. Although I don't usually use multiple languages, I can imagine this would be pretty annoying for a user with multiple languages to have to do *every* time they purchase an extension. (Plus, it creates more work for us developers to have to field questions about not having the correct language files.)
LOL you just realized this now? ;)
Yes this is the main reason for the need for a fallback.

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by Johnathan » Sun Jul 24, 2011 5:00 am

Qphoria wrote:LOL you just realized this now? ;)
Yes this is the main reason for the need for a fallback.
Yeah, I was a bit slow on the uptake on this one. :whistle: I had read the complaints about it, but since I rarely use multiple languages I never really thought about it in the context of installing new extensions.

Image Image Image Image Image


User avatar
Administrator

Posts

Joined
Fri Dec 18, 2009 3:08 am


Post by Qphoria » Wed Aug 10, 2011 9:29 pm

Anyway, in the meantime, for those that want the language fallback in 1.5.x. Just use the system/library/language.php file from 1.4.9.x. I've attached the one from v1.4.9.6
Confirmed working with versions up to 1.5.1.3

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am
Who is online

Users browsing this forum: No registered users and 7 guests