Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multi-lingual support #242

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

Corentin-Aulagnet
Copy link

I added support for french but tried to do it in a way that it is relatively easy to add other Latin-alphabet-based languages.

It works with a new class Translator, it stores all the translations for the part names (like string, barrel, etc) in a dictionary.

What did you fix?

I tried to fix Multi-Language OCR Support
closes #67

Evidence/screenshot/link to line

image

Considerations

  • It still need some polish, since all displays are not translated but the detection is good
  • Does this contain a new dependency? [No]
  • Does this introduce opinionated data formatting or manual data entry? [Yes] I think this is not ideal.
  • Have I run the linter? [No]
  • Is is a bug fix, feature request, or enhancement? [Enhancement]

…ittle bit tested.

A class Translator is added, it stores all the translations for the part names (like string, barrel, etc)
@dimon222
Copy link
Member

dimon222 commented Jun 25, 2022

Interesting approach, but one of the reasons we don't use this kind of mechanics is that we want use out of the box translation payloads provided by Warframe.market (you might be able to see it in source draft PR). Is there a reason you don't use same way and instead manually translate the part names?

@Corentin-Aulagnet
Copy link
Author

I completely understand the problem with my solution. But I wasn't able to reproduce the request to the warfame.market API but in french. For exemple : "https://api.warframestat.us/wfinfo/filtered_items" which is (I believe) the base data set.

I will try working on another solution with the data from warframe.market. Could you explain how the custom "wfinfo" request was made ?

@D1firehail
Copy link
Contributor

The ReloadItems function takes care of fetching the translation data according to the locale setting (which your change to SettingsWindow.xaml should already take care of). getLocaleNameData accepts the english name and returns it translated according to the WFM translation data for use in language-specific levenshtein distance functions. You can see #231 for a mostly correct implementation and my comment there for what's missing (although note that Master It is currently broken due to in-game UI changes)

… on warframe market. It is similar to WFCD#231

MasterIt has not been tested.
Displays are not translated.
@Corentin-Aulagnet
Copy link
Author

I just pushed another version similar to the one from #231. As I said in the commit message, I did not check either Master It or the translation of the displays.

I will work on understanding how Master It works.

Corentin-Aulagnet and others added 5 commits July 7, 2022 21:44
…nch langage. I was'nt able to test it as it does not work at the time of this commit
…ittle bit tested.

A class Translator is added, it stores all the translations for the part names (like string, barrel, etc)
…of resources files to translate all hard coded texts.

The UI texts are not translated yet.
Added a status message to inform the user that the locale has been changed
The equiment is redrawn each time it is opened
…displaying the initialization messages from the wrong locale.
@Corentin-Aulagnet
Copy link
Author

Ok ok, some news from here. I had a bit of trouble with git after the release of 9.5.4
I tried to get the cleanest history I could after the mistakes I made.

The last interesting commits are focused on UX.
The displays in the equipment window are now in the correct language (locale data come from the market_item.json files.
I implemented resources files called "strings" and "strings.fr" They can be used to translate all hard coded texts such as status messages etc. I am working on a way to translate the UI (all ard coded texts in the .xaml).
If you have any clues on how to do this, I would appreciate it.

I also have, at the time when I write this message modified the output texts of the Snap-It to display the local names of the parts. I will refactor it to work for all displays.

I think this version is production ready, as long as the users speak a bit of english (UI) but I assume they do if they end up downloading this tool. What do you think ?

@KuzyXD
Copy link

KuzyXD commented Jan 12, 2023

I want it to merge!

@dimon222
Copy link
Member

Conflict, sadly.

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

Successfully merging this pull request may close these issues.

Multi-language OCR support
4 participants