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

Multiple Language Support #43

Merged
merged 10 commits into from
Aug 3, 2024
Merged

Multiple Language Support #43

merged 10 commits into from
Aug 3, 2024

Conversation

XKaguya
Copy link
Contributor

@XKaguya XKaguya commented Aug 2, 2024

This feature is based on the gettext module. It will load localization before the window appears. I have no clue about how to do this in real-time.

Localization repository: https://github.com/XKaguya/OSCR-Localization

No issues have been found so far.

The currently localization was machine translate. Which might not be right.

image
image

I can't modify the messages that using the OSCR package currently because its hard code.

@Kraust
Copy link
Contributor

Kraust commented Aug 3, 2024

Changes look good. Just let us know whenever you're done.

@Kraust Kraust changed the title Add language switch Multiple Language Support Aug 3, 2024
@Kraust Kraust added the enhancement New feature or request label Aug 3, 2024
@XKaguya
Copy link
Contributor Author

XKaguya commented Aug 3, 2024

It is done, I think. I tested it myself and did not find anything that may be broken by me. It may still need further testing.

Currently, the language is loaded before the leagueapi. The language file is located in the locales folder. However, changing the language option requires modifying the source code.

So far, we have support for four languages. All translations were done using Google Translate, which may not be entirely accurate.

If you notice any issues or have suggestions, please feel free to open an issue or make a pull request in this repository.

The localization process is straightforward. Fork my localization repo and follow these steps (this might change in the future):

  1. Copy the messages.po file inside locales\en\LC_MESSAGES.
  2. Create a folder with the correct name and put the modified messages.po inside it. It should look like this: locales\YOUR_LANGUAGE\LC_MESSAGES\messages.po.
  3. Make a pull request to me, and I'll handle the formatting. This step also requires changing the OSCR's source code.

I have no plans to translate Player and NPC because I think there's no need to translate these two words.

There are also words that cannot be translated, such as the server's response. Doing so would make the code messy, as I don't want to include a lot of dictionaries in the code.

@Kraust
Copy link
Contributor

Kraust commented Aug 3, 2024

Only comment right now is that we'll probably want to move over the repo to the STOCD account at some point.

@XKaguya
Copy link
Contributor Author

XKaguya commented Aug 3, 2024 via email

@Kraust
Copy link
Contributor

Kraust commented Aug 3, 2024

We can either fork the repo or the ownership can be transferred. Not a huge issue. Will merge and test unless @Shinga13 has any objections.

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

Successfully merging this pull request may close these issues.

2 participants