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

Platform specific localizations? #7

Closed
rdantonio opened this issue May 9, 2017 · 4 comments
Closed

Platform specific localizations? #7

rdantonio opened this issue May 9, 2017 · 4 comments

Comments

@rdantonio
Copy link

Not sure if I'm just being dumb and missing something but we need to support languages like Simplified/Traditional Chinese and I can't seem to find a way to make this work for both Android and iOS with the same file(s).

For example prior to using this I had for Android:

  • zh-rCN
  • zh-rHK
  • zh-rTW

and for iOS:

  • zh-Hans
  • zh-Hans-CN
  • zh-Hant
  • zh-Hant-TW

If I use one or the other one platform doesn't work, and putting them all will also throw errors as I don't see a way to exclude certain files from a specific platform. Any suggestions or help would be greatly appreciated!

@kelvinhokk
Copy link
Owner

What do you think if we add an optional locale in the json file to support locales with region? The idea, is instead of reading the locale from the file name (by default), the plugin will check for the locale.ios or locale.json.

zh-Hans.json

{
	"locale": {
		"ios": ["zh-Hans"],
		"android": ["zh-rCN"]
	},
	"config_ios": {
		"NSCameraUsageDescription": "扫描二维码",
		"CFBundleDisplayName": "应用程序名称",
		"CFBundleName": "应用程序名称"
	},
	"config_android": {
		"app_name": "应用程序名称"
	},
	"app": {
		"HAVE_MAIL_TITLE": "你收到了邮件",
		"HAVE_MAIL_MSG": "%1$@给您发送了封邮件,标题为\\\"%2$@\\\""
	}
}

zh-Hant.json

{
	"locale": {
		"ios": ["zh-Hant"],
		"android": ["zh-rTW", "zh-rHK"]
	},
	"config_ios": {
		"NSCameraUsageDescription": "掃描二維碼",
		"CFBundleDisplayName": "應用程序名稱",
		"CFBundleName": "應用程序名稱"
	},
	"config_android": {
		"app_name": "應用程序名稱"
	},
	"app": {
		"HAVE_MAIL_TITLE": "你收到了郵件",
		"HAVE_MAIL_MSG": "%1$@給您發送了封郵件,標題為\\\"%2$@\\\""
	}
}

@rdantonio
Copy link
Author

Sorry for the delay in response, this sounds like it would work perfectly for us!

@kelvinhokk
Copy link
Owner

kelvinhokk commented Jul 5, 2017

Hi rdantonio, I have just added support for this in version 1.1.0

Would you like to try it out?

@rdantonio
Copy link
Author

Finally had a chance to test this out - it works great! Thank you for the effort!

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