Ticket #3674 (closed defect: fixed)

Opened 3 years ago

Last modified 2 years ago

Internationalisation problem - showing "Object object" or "nulls" on buttons

Reported by: Zverik Owned by: potlatch-dev@…
Priority: major Milestone:
Component: potlatch2 Version:
Keywords: locale Cc: Diomas, Nzara, openstreetmap@…, miurahr, post@…

Description

A user failed to enable GPS tracks display, because he didn't find the button. The reason? It is called [object Object].

Windows XP Pro SP3, Opera 10.10.1893, Flash 10.1.85.3

Attachments

objectobject256.jpg Download (253.3 KB) - added by Zverik 3 years ago.
objectobject110429.gif Download (123.0 KB) - added by Zverik 3 years ago.
potlatch2_systemed_HEAD_localize_fail.png Download (165.7 KB) - added by miurahr 3 years ago.

Change History

Changed 3 years ago by Zverik

comment:1 Changed 3 years ago by TomH

When was this? Only I thought I fixed that last week...

comment:2 Changed 3 years ago by TomH

  • Status changed from new to closed
  • Resolution set to fixed

I've just set my language to russian (this is a language triggered issue) and it is working fine so I think this must have happened during the brief period when we were using the broken en_US locale as the fallback in Potlatch 2.

We're using the (working) en_GB locale now so I don't think this will be happening anymore.

Changed 3 years ago by Zverik

comment:3 Changed 3 years ago by Zverik

  • Status changed from closed to reopened
  • Resolution fixed deleted

Today this bug was reported by another user (see screenshot). Did that "brief period of using broken locale" happen again? I can ask the user to gather any info you need.

comment:4 Changed 3 years ago by Nop

I observe the same problem. I have set the locale to "de_DE" explicitly, but P2 remains in English and the [Object] shows.

P2 and locales were freshly updated from randomdev and show g106bbd1.

comment:5 Changed 3 years ago by Diomas

  • Cc Diomas added

I have the same problem. OSM site shows me GUI in Russian, but Potlatch 2 is in English and shows [object Object] instead of GPX traces.

Potlatch version: 2.2-6-gaa899ca Flash player: 11.0.0.60 (linux)

comment:6 Changed 3 years ago by Nop

also see discussion in Ticket #3687

comment:7 Changed 3 years ago by Nzara

  • Cc Nzara added

comment:8 Changed 3 years ago by openstreetmap@…

I've added cache expiry headers for osm.org potlatch2 instance as I suspect old locally cached locale files may be causing this bug.

Now to see if it helps...

comment:9 Changed 3 years ago by openstreetmap@…

  • Cc openstreetmap@… added

comment:10 Changed 3 years ago by Andy Allan

  • Summary changed from object Object instead of GPS data to Internationalisation problem - showing "Object object" or "nulls" on buttons

I'm going to make this more obvious in order to help people searching trac, so I've updated the summary.

There is a problem with the internationalisation in p2, where it doesn't work for some people. Internally, p2 thinks the locale is loaded, when actually it's not.

We don't know what causes this. We don't know how to fix it. We don't know how to recreate it. So far nobody has stepped forward to help pin down exactly what combination of browser / operating system / locale / browser locale / whatever leads it to happen.

comment:11 Changed 3 years ago by miurahr

  • Owner changed from potlatch-dev@… to miurahr
  • Status changed from reopened to assigned

I take this and make work it.

comment:12 Changed 3 years ago by miurahr

Need review;

 https://github.com/osmfj/potlatch2/commits/i18n

working fine with Ubuntu linux natty 64bit FF6.0.2 and Midori;

MacOS Lion Chrome, FF, Safari.

You can easily test at

default configuration(en_GB):  http://www.openstreetmap.jp/potlatch2/potlatch2.html

Japanese configuration:  http://www.openstreetmap.jp/potlatch2/osmjp.html

de_DE.  http://www.openstreetmap.jp/potlatch2/de.html

comment:13 Changed 3 years ago by miurahr

  • Cc miurahr added
  • Owner changed from miurahr to potlatch-dev@…

Sorry wrongly assigned me. revert.

comment:14 Changed 3 years ago by miurahr

Core part of suggested fixes is as follows in  https://github.com/osmfj/potlatch2/commit/0ede5b82918f63d14263f65b4de45f61ff715b71 for potlatch2.mxml:

+   if (loaderInfo.parameters['locale']) {
+                var uselocale:String = loaderInfo.parameters['locale'];
+                dispatchEvent(new LocaleEvent(LocaleEvent.LOAD_LOCALE,uselocale));
+                dispatchEvent(new LocaleEvent(LocaleEvent.LOAD_LOCALE, 'en_US'));
+                resourceManager.localeChain = [uselocale,'en_US'];
+            }

To acitivate new locale, we need to load new locale and base locale 'en_US'. And then changing localeChain, internal event is happened and message injection is executed.

Other parts are patches to fix minor bug and for depending on babelFX version, build script, and message additions.

Changed 3 years ago by miurahr

comment:15 Changed 3 years ago by miurahr

it is still reproduced on HEAD of systemed branch: v2.3 when adding argslocale?="de_DE"; in resource/potlatch2.html

see attachment.  http://trac.openstreetmap.org/attachment/ticket/3674/potlatch2_systemed_HEAD_localize_fail.png

compile on Ubuntu Linux 11.04 (64bit) with flex-sdk 4.5.0 run on firefox 6.0.2, Shockwave Flash 10.3 d162 plugin.

comment:16 Changed 3 years ago by miurahr

It works fine that merged proposal patch on top of v2.3, top of systemed tree.

 https://github.com/osmfj/potlatch2/tree/i18n-flex4

that includes #4010 feature.

comment:17 follow-up: ↓ 18 Changed 3 years ago by TomH

Andy is working on sorting out the BabelFX stuff - see his discussion with the developers here:

 http://support.babelfx.org/discussions/problems/35-error-compatibility-version-has-already-been-read

comment:18 in reply to: ↑ 17 Changed 3 years ago by miurahr

The issue that Tom pointing out seems to be an issue for develop or runtime environmental one. This look like;  http://forums.adobe.com/message/3805967

Replying to TomH:

Andy is working on sorting out the BabelFX stuff - see his discussion with the developers here:

 http://support.babelfx.org/discussions/problems/35-error-compatibility-version-has-already-been-read

and it is not reproduced on my environment(ubuntu linux 11.04(amd64), firefox7.0.1,debug flash plugin Flash 10.2 r159 that is bundled with flex-sdk 4.5.1) on Andy's tree.

I need to fix 2 issues in order to compile andy's tree successfully with flex 4.5.1. see  https://github.com/osmfj/potlatch2/commits/andy-i18n I'm afraid how it is compiled by him.

Following is a log by flash debugger(fdb) of flex-sdk 4.5.1 on andy-i18n branch.

...(snip)
Additional ActionScript code has been loaded from a SWF or a frame.
To see all currently loaded files, type 'info files'.
Set additional breakpoints as desired, and then type 'continue'.
(fdb) c
[trace] warning: unable to bind to property 'theMap' on class 'potlatch2'
[SWF] /FontLibrary.swf - 681,913 bytes after decompression
[SWF] /locales/de_DE.swf - 56,294 bytes after decompression
[trace] ?? : ???? dev.virtualearth.net ??????????????????????????????? 'master-only' ??????????????????????????????????????http://www.adobe.com/go/strict_policy_files_jp ??????????
[SWF] /potlatch2.swf - 226 bytes after decompression
...(snip)

comment:19 Changed 2 years ago by post@…

  • Cc post@… added
  • Keywords locale added

This bug is still there, and pretty debilitating. Latest Firefox, Chrome and Opera on latest stable Ubuntu using Openstreetmap.org (Version: 2.3 Build: 2.3-136-g81ae8fd Locale: en_US). (It has also been reported in the forums and on mailing lists.)

If I use the en_GB locale instead, there's no problem. It thus seems that the only short term change that is needed is to make the en_GB the default english locale, at least the default fallback locale.

comment:20 Changed 2 years ago by Richard

  • Status changed from assigned to closed
  • Resolution set to fixed
Note: See TracTickets for help on using tickets.