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

#87 - implemented I18n localization for android and iOS #287

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

akshaydoshi2
Copy link

/claim #87
I18n localization for android and iOS has been implemented.

For Android:

  1. The key-value pairs for localizations can be found in res/values-<language_code>/strings.xml
  2. The file res/values/strings.xml is the fallback file. If the user selects any language that is not implemented by us, the values from this file are used.
  3. These strings can be used in the app using Resources.getSystem().getString(R.string.<name_property>). For eg: Resources.getSystem().getString(R.string.hello_world)
  4. New languages can be added by simple creating new folder like in: res/values-<language_code>/strings.xml and inserting all the translated strings.

For iOS:

  1. The key-value pairs for localizations can be found in Localizable in the left navigation pane.
  2. Each language uses a separate file named as Localizable (language) in the left navigation pane.
  3. The strings can be accessed by: NSLocalizedString(<key_name>, comment:""). For example: NSLocalizedString("hello_world", comment:"").
  4. New languages can be added by doing the following in XCode: `Plugin (in the left navigation pane) -> Plugin (Project) -> Info -> Localizations -> Press (+) -> Select language

For both android and iOS, the keys of all the translated matching strings should match. Else the translations will not work.

Copy link

@ologbonowiwi ologbonowiwi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

android/src/main/res/values/strings.xml Outdated Show resolved Hide resolved
ios/Plugin/CapacitorUpdaterPlugin.swift Outdated Show resolved Hide resolved
akshaydoshi2 and others added 3 commits October 18, 2023 19:33
Co-authored-by: Wesley <100464352+ologbonowiwi@users.noreply.github.com>
@sonarcloud
Copy link

sonarcloud bot commented Oct 18, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@akshaydoshi2
Copy link
Author

@riderx can you check this please?

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

Successfully merging this pull request may close these issues.

None yet

4 participants