NativeScript / NativeScript/plugins

@nativescript/localize, Android bug, Cannot add language file with region specifier

Open
#246 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
206
Forks
123
Avg merge
2d 1h
Merged PRs (30d)
1

Description

Hello together, I am currently trying to add simple Chinese (zh.json) and traditional Chinese (zh-hant.json) language files to my app using the localize plugin.
Both files work as expected when building the ios app. However, with the zh-hant.json file included in the sources I cannot build the android version of my app. I get the following error message:

ERROR:/Users/cjohn/Entwicklung/MND/my-nutri-diary/mnd/platforms/android/app/src/main/res/values-zh-rhant: Resource and asset merger: Invalid resource directory name

Execution failed for task ':app:mergeDebugResources'.
/Users/cjohn/Entwicklung/MND/my-nutri-diary/mnd/platforms/android/app/src/main/res/values-zh-rhant: Error: Invalid resource directory name

Would be great if someone could help. Thanks!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing how @nativescript/localize converts language filenames into Android resource directories, using zh.json and zh-hant.json as the reproduction case. Run the Android build and verify that the generated directory for the regional language uses a valid Android resource name and that the build succeeds.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, typescript
Domain
build-system, localization, mobile-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.