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

How to handle translations? #665

Closed
solojuve1897 opened this issue Jul 19, 2018 · 2 comments
Closed

How to handle translations? #665

solojuve1897 opened this issue Jul 19, 2018 · 2 comments

Comments

@solojuve1897
Copy link
Contributor

solojuve1897 commented Jul 19, 2018

capacitor/android/capacitor/src/main/java/com/getcapacitor/plugin/Camera.java

JSObject fromPhotos = new JSObject();
      fromPhotos.put("title", "From Photos");
      JSObject takePicture = new JSObject();
      takePicture.put("title", "Take Picture");

Trying out the Camera-plugin. My phone is in Swedish but I got titles in English "From Photos" and "Take Picture". Was able to find relevant file.

What are you thinking with regards to being able to translate titles/buttons/whatever?

I'm suggesting being able to pass custom texts whenever relevant like in this case (in the options object for example).

@solojuve1897
Copy link
Contributor Author

This specific issue is not relevant for me anymore since I have changed the logic so that the user chooses Photos or Camera as CameraSource before the call is made. Still relevant though to handle places where texts are hard-coded.

@jcesarmobile
Copy link
Member

Going to close the issue.

For hardcoded texts we plan to do something like what explained in this issue #872
or use the native ways, but we will get rid of hardcoded english messages.

For buttons on native UIs, that's really handled by the system, english is default because that's the default development region. If you want just to support a different language change the region in the info.plist.
If you want to support multiple languages you can add the CFBundleLocalizations key with multiple values, and if the user's device language matches one of those it will automatically show the screens with proper messages

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

No branches or pull requests

2 participants