tinganho / l10ns

Internationalization workflow and formatting
http://l10ns.org
Apache License 2.0
234 stars 24 forks source link

Offset in key preview on homepage. #128

Open cadesalaberry opened 8 years ago

cadesalaberry commented 8 years ago

On the first page, everything is fine, but when I load the second page, the previews start to get mixed up.

In my example here, SIGNUP__LOCALIZATION_EMPTY is correct. However when I load more content, the key AWARDS__CARD__SCORE__UNIT displays

AWARDSCARDSCORE__UNIT | Swipe left to continue

Instead of

AWARDSCARDSCORE__UNIT | PTS

I started investigating, but haven't found out from where it was coming yet.

I suspect it might be related to key ordering in the json files but can't confirm as of now.

@tinganho Could you give me a hand on this issue ?

screenshot from 2016-07-07 12 00 42

screenshot from 2016-07-07 12 00 59

screenshot from 2016-07-07 12 01 21

tinganho commented 8 years ago

@cadesalaberry could you share the project or an example project with me?

cadesalaberry commented 8 years ago

Sorry, it took me some time to generate the files, and strip the unnecessary content.

I uploaded the pertinent files on https://github.com/cadesalaberry/l10ns-offset if you care to have a look.

Cheers

cadesalaberry commented 8 years ago

@tinganho did you have time to checkout the issue ?

As I understood it, the json localization files is ordered by timestamp.

if you add a language to the localization (fr-FR), the new localization file (fr-FR.json) will be ordered by key because they will all have the same timestamp.

You will then have two files with the keys in different orders.

Do you think that is where it comes from ?

tinganho commented 8 years ago

@cadesalaberry I looked into the example project. Seems like the project doesn't have the key AWARDS__CARD__SCORE__UNIT in en-US? The file en-US and es-ES seem misaligned?

tinganho commented 8 years ago

You could probably manually try to correct those files. By adding one entry into the other and see what happens.

cadesalaberry commented 8 years ago

I updated the files, but the offset is still present:

screenshot from 2016-10-04 14-50-34

screenshot from 2016-10-04 14-50-58

tinganho commented 8 years ago

@cadesalaberry the timestamps and orders in the shared project is very misaligned. The mentioned entry is just one case, but I can find many more.

Do you happen to know how they became misaligned?

cadesalaberry commented 8 years ago

That's because I added es-ES after creating my en-US file.

I think ordering the json file by key, would help avoid that bug.

tinganho commented 8 years ago

I think I will just use the order of the default language. And remove the timestamp entries on non-default languages. Though I think this change is quite big and more suitable for a future release.

cadesalaberry commented 8 years ago

Alright, sounds good !

Are you talking about the v3 ?

tinganho commented 8 years ago

Yes, though I'm afraid it won't be happening soon.