ACHNBrowserUI icon indicating copy to clipboard operation
ACHNBrowserUI copied to clipboard

Item / data localization

Open bigrck64 opened this issue 5 years ago • 22 comments

As you know, the http://acnhapi.com/ can display any catalog item in the correct localisation. Would it be possible to add on option to let user choose the database language ?

bigrck64 avatar Apr 22 '20 14:04 bigrck64

For items we use a local catalog dump, which for now is english only. In the mid/long I think we'll need to localize it fully. For villagers I'll display their name in your local language if available quite soon as we have the info from acnhapi yeah :) And for the rest of the app, the UI, anyone is welcome to do a PR do make it available :)

Dimillian avatar Apr 22 '20 15:04 Dimillian

should be relatively easy to generate a localization from this: https://pastebin.com/B8N5KKsh. has strings for diff languages in relation to items.

ericlewis avatar Apr 22 '20 16:04 ericlewis

What are the preferred plans for this? Do you prefer translation relying on Localizable.strings or by patching the JSON-files?

vknabel avatar May 10 '20 19:05 vknabel

I’ll take a look at that a bit later, but with 5000+ items we’ll use a translated data source, I’ll just pull another json.

Dimillian avatar May 10 '20 19:05 Dimillian

Maybe imthe666st/ACNH can help you here. I also wrote a short playground script to generate a Localizable.strings file.

Only tested it for a few minutes, but works pretty well after adding a few LocalizedStringKey and NSLocalizedString.

vknabel avatar May 10 '20 21:05 vknabel

This is perfect! Thank you so much for the repo link. With those JSON we just have to match the internal id with our datasource and done. Crazy. I'll be able to do it in no time :)

Dimillian avatar May 11 '20 05:05 Dimillian

Note: We'll not use Localizable.string. I'll pull the Locale from the phone, and then load the appropriate translation JSON and replace the item name with the one pulled from the file.

Dimillian avatar May 11 '20 05:05 Dimillian

You're code is a great help, I'm almost done :)

Dimillian avatar May 11 '20 06:05 Dimillian

Screenshot 2020-05-11 at 08 55 43

Dimillian avatar May 11 '20 06:05 Dimillian

Great to hear and happy to help! The localizable approach was just the quickest and easiest way to get a prototype working. I guess patching the dataset is better, too!

As a side note: in the current data set, the first letter is capitalized, whereas in the linked one most names are lowercased in English.

vknabel avatar May 11 '20 07:05 vknabel

Yup fixed that too, commiting in 5 minutes. You'll see, I like the approach I did. We load current localization table in memory in just query it from the Item.

Dimillian avatar May 11 '20 07:05 Dimillian

https://github.com/Dimillian/ACHNBrowserUI/commit/081c8469d9f8b4c04ae336a49565967ce9f6ec01 @vknabel It's basic but it works :) So happy we have that nailed down in so little time!

Dimillian avatar May 11 '20 07:05 Dimillian

You're welcome to do adjustment as you see fit :)

Dimillian avatar May 11 '20 07:05 Dimillian

Thank you very much @Dimillian. I will take a look this evening in about 9-12 hours!

vknabel avatar May 11 '20 07:05 vknabel

Awesome that was quick ! :)

bigrck64 avatar May 11 '20 10:05 bigrck64

It works very well! From my perspective, this is done. I opened #111 for a small and rare edge case. But good and blazingly fast work!

vknabel avatar May 11 '20 16:05 vknabel

For items localizations data for now we have:

  • English
  • French
  • Japanese
  • Chinese
  • German
  • Russian
  • Spanish
  • Italian

Dimillian avatar May 14 '20 14:05 Dimillian

Would it be possible to add on option to let user choose the database language ?

That would be great indeed. I have my phone set to English but the game is set to French. Makes it quite hard to find items 😉

Arnoud-B avatar Dec 12 '20 22:12 Arnoud-B

Hey @Arnoud-B, you already can do that. You can set App language to a different then device language. Go to iOS settings app, scroll down to app section, select AC Helper and set language to French. (Screenshots are German, but I think you'll get what to do) image image

TheVaan avatar Dec 14 '20 07:12 TheVaan

Thanks @TheVaan. That solves it indeed, but I think most users won't go to the Settings app to find this option but instead rely on the app settings (in the app itself). Why not expose it there?

Arnoud-B avatar Dec 14 '20 10:12 Arnoud-B

We did this because of apples localization guide lines. There are ways to build in a translation Switcher inside an app but this is often buggy (for SwiftUi). We decided to use the Apple way (introduced in iOS 13) and not to implement a buggy way. I agree it's not that easy to find but it's the way Apple wants us to do.

TheVaan avatar Dec 14 '20 10:12 TheVaan

OK, good to know. Perhaps a mention in the app with a direct link to the AC Helper section in the Settings would be worth considering? (I've seen that in several apps)

Arnoud-B avatar Dec 14 '20 11:12 Arnoud-B