Function uc_get_field_name() in uc_store_module translates strings. But afterwards these translated strings are stored in table variable. Later calls to this function fetch the strings from variable. So it's impossible to set up a multi language site.

I attached a patch to not use varables at this point.
BTW I don't see any sense in using variables here. Maybe old code?

Comments

rszrama’s picture

Status: Needs review » Needs work
Issue tags: +i18n

Yeah, this is certainly some legacy code that will be fixed in 3.x, but your patch here isn't enough. It would basically preserve the translation for multilingual sites but leave an entire settings form inoperable since changes wouldn't be saved as users expect. My preferred solution would be to detect if the field name was left at its default setting. If so, return the translated string instead of the variable. Then you could still use the form for single language sites and multilingual sites could be instructed to use String Overrides.

rszrama’s picture

Version: 6.x-2.0-rc3 » 6.x-2.x-dev
Status: Needs work » Postponed
Island Usurper’s picture

Status: Postponed » Needs review
StatusFileSize
new8.12 KB

How about if we tell the i18n module about those variables? There's a patch in a forum thread on ubercart.org that I think you'd be interested in. Multi-lingual customizable form element titles and messages

Here's the latest version of that patch, as well.

Island Usurper’s picture

Issue tags: +Release blocker

There's a bug in the 1.1 version of i18n that prevents the default English values from being displayed if a variable has been translated. It's been fixed, but a new release hasn't been made yet. I haven't committed this patch because I don't want to deal with all of the useless error reports that will cause.

However, we can't just leave this patch sit forever, so I added the "Release blocker" tag. It'll be in the next release even if i18n hasn't updated then.

Island Usurper’s picture

Status: Needs review » Fixed

Eh, I got tired of waiting. If people have problems seeing the English values that Ubercart provides by default, tell them to get the dev version of i18n. Or point them to #527534: Unset variables set to be multilingual don't show default values for the patch.

Committed.

Status: Fixed » Closed (fixed)
Issue tags: -i18n, -Release blocker

Automatically closed -- issue fixed for 2 weeks with no activity.