Skip to content
This repository has been archived by the owner on Jul 24, 2021. It is now read-only.

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

Closed
openstreetmap-trac opened this issue Jul 23, 2021 · 18 comments

Comments

@openstreetmap-trac
Copy link

Reporter: Zverik
[Submitted to the original trac issue database at 1.12pm, Sunday, 10th April 2011]

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

@openstreetmap-trac
Copy link
Author

Author: TomH
[Added to the original trac issue at 7.27am, Monday, 11th April 2011]

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

@openstreetmap-trac
Copy link
Author

Author: TomH
[Added to the original trac issue at 7.29am, Monday, 11th April 2011]

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.

@openstreetmap-trac
Copy link
Author

Author: Zverik
[Added to the original trac issue at 10.52am, Friday, 29th April 2011]

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.

@openstreetmap-trac
Copy link
Author

Author: Nop
[Added to the original trac issue at 9.32am, Saturday, 30th April 2011]

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.

@openstreetmap-trac
Copy link
Author

Author: Diomas
[Added to the original trac issue at 1.39am, Thursday, 23rd June 2011]

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)

@openstreetmap-trac
Copy link
Author

Author: Nop
[Added to the original trac issue at 1.09pm, Thursday, 7th July 2011]

also see discussion in Ticket #3687

@openstreetmap-trac
Copy link
Author

Author: openstreetmap[at]firefishy.com
[Added to the original trac issue at 3.55pm, Friday, 15th July 2011]

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...

@openstreetmap-trac
Copy link
Author

Author: Andy Allan
[Added to the original trac issue at 7.08pm, Sunday, 4th September 2011]

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.

@openstreetmap-trac
Copy link
Author

Author: miurahr
[Added to the original trac issue at 11.12pm, Thursday, 15th September 2011]

I take this and make work it.

@openstreetmap-trac
Copy link
Author

Author: miurahr
[Added to the original trac issue at 11.38pm, Thursday, 15th September 2011]

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

@openstreetmap-trac
Copy link
Author

Author: miurahr
[Added to the original trac issue at 8.40pm, Friday, 16th September 2011]

Sorry wrongly assigned me. revert.

@openstreetmap-trac
Copy link
Author

Author: miurahr
[Added to the original trac issue at 9.54pm, Friday, 16th September 2011]

Core part of suggested fixes is as follows in osmfj/potlatch2@0ede5b8 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.

@openstreetmap-trac
Copy link
Author

Author: miurahr
[Added to the original trac issue at 1.21am, Saturday, 1st October 2011]

it is still reproduced on HEAD of systemed branch: v2.3 when adding args["locale"]="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.

@openstreetmap-trac
Copy link
Author

Author: miurahr
[Added to the original trac issue at 8.24am, Sunday, 2nd October 2011]

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.

@openstreetmap-trac
Copy link
Author

Author: TomH
[Added to the original trac issue at 9.47am, Sunday, 2nd October 2011]

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

@openstreetmap-trac
Copy link
Author

Author: miurahr
[Added to the original trac issue at 3.52am, Wednesday, 5th October 2011]

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 [comment:17 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)

@openstreetmap-trac
Copy link
Author

Author: post[at]guttormflatabo.com
[Added to the original trac issue at 10.11am, Tuesday, 21st February 2012]

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.

@openstreetmap-trac
Copy link
Author

Author: Richard
[Added to the original trac issue at 1.41am, Friday, 16th March 2012]

Fixed in systemed/potlatch2@c79b527 .

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant