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

Add support for changing app language #290

Closed
cfoellmann opened this issue Feb 5, 2024 · 4 comments
Closed

Add support for changing app language #290

cfoellmann opened this issue Feb 5, 2024 · 4 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@cfoellmann
Copy link

Have you thought about providing translation support?

I am looking for an rss app for our staff and would be happy to provide German and maybe polish translations

@msasikanth
Copy link
Owner

msasikanth commented Feb 6, 2024

Yes! Thank you. Right now you can find the English version of the strings here. What I would recommend doing is, creating a Google Sheet with key and translated string for the language. I can then create the Kotlin class.

Or if you are comfortable with forking and cloning the project, and creating new Kotlin classes, that would be great as well. Here is the process.

  1. Edit the Locales object in TwineStrings.kt to add a new locale ISO tag. In your case de for Germany and pl for Polish.
object Locales {
  const val EN = "en"
  const val DE = "de"
  // more locales
}
  1. Then create a new file under the same package as EnTwineStrings, you just have to attach the ISO prefix to the TwineStrings name. So, we will have DeTwineStrings.

  2. In that file create a new variable called DeTwineStrings and initialise the TwineStrings data class to add your translations.

@LyricistStrings(languageTag = Locales.DE, default = false)
val DeTwineStrings = TwineStrings(
  // translations
)
  1. Run ./gradlew spotlessApply task before raising a PR to make sure code style checks pass.

If this process is a lot, feel free to fallback to just providing me with the Google Sheet, and I can make these changes.

@cfoellmann
Copy link
Author

Thanks for the fast reply.
I am on vacation soon but will look into it when I get back

@msasikanth msasikanth added enhancement New feature or request good first issue Good for newcomers labels Feb 6, 2024
@msasikanth msasikanth changed the title Language support Add support for changing app language Feb 12, 2024
@FreedomChuks
Copy link
Contributor

I was able to raise a PR for addition of a german translation

@FreedomChuks
Copy link
Contributor

I would add support for other languages at the weekend

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

No branches or pull requests

3 participants