Open bigrck64 opened 4 years ago
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 :)
should be relatively easy to generate a localization from this: https://pastebin.com/B8N5KKsh. has strings for diff languages in relation to items.
What are the preferred plans for this? Do you prefer translation relying on Localizable.strings or by patching the JSON-files?
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.
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
.
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 :)
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.
You're code is a great help, I'm almost done :)
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.
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.
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!
You're welcome to do adjustment as you see fit :)
Thank you very much @Dimillian. I will take a look this evening in about 9-12 hours!
Awesome that was quick ! :)
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!
For items localizations data for now we have:
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 😉
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)
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?
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.
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)
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 ?