weblate icon indicating copy to clipboard operation
weblate copied to clipboard

Valencian language breaks projects that use compose/android resources

Open ssalggnikool opened this issue 2 months ago • 4 comments

Describe the issue

someone added the Valencian language to my project and since android does not recognise it it prevents my app from building and working properly

the folder that gets added is composeResources/values-ca@valencia, which is not a valid language identifier on android

there's seemingly no way to blacklist this language from being added so i have to tell translators to not add it which is annoying

this may also be the case for other languages but im not sure

I already tried

  • [x] I've read and searched the documentation.
  • [x] I've searched for similar filed issues in this repository.

Steps to reproduce the behavior

  1. make a project which uses android/compose resources
  2. add valencian language
  3. merge weblate's pr
  4. app no longer builds

Expected behavior

this language should not be allowed for android/compose projects since android/compose doesn't support it

Screenshots

No response

Exception traceback


How do you run Weblate?

weblate.org service

Weblate version

weblate-2026.9.1-425-g04e1f80825

Weblate deploy checks


Additional context

No response

ssalggnikool avatar Sep 22 '26 15:09 ssalggnikool

Do you know what is correct language code for that?

nijel avatar Sep 22 '26 17:09 nijel

Do you know what is correct language code for that?

as far as i'm aware, there is none, android/compose resources simple doesn't support it

ssalggnikool avatar Sep 24 '26 18:09 ssalggnikool

It should be values-b+ca+valencia (rationale for that below). However, there is a separate Android tools bug, and this valid value is not recognised, see https://issuetracker.google.com/issues/293294923.

For the moment, Weblate should probably special case Valencian and (a) not export it when generating Android resources, and (b) don't allow users to select Valencian if it's a single-format project exporting Android string resources.


The Valencian language is a subgroup of the broader Catalan family, per https://en.wikipedia.org/wiki/Valencian_language.

From https://developer.android.com/guide/topics/resources/providing-resources the language qualifier is either:

  1. Two letter ISO 639-1 language code, Catalan is ca, there is no ISO 639-1 code for Valencian.

  2. Two letter ISO 639-1 language code, a literal -r, and a two letter ISO 3166-1-alpha-2 region code.

According to https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2 there is no ISO 3166-1-alpha-2 region code for Valencia.

  1. Android API 24 and up support BCP 47 language tags, b+, a two-letter ISO 639-1 language code, and optional subtags separated by + (note: BCP 47 uses - as the separator, I assume Android uses + to avoid clashes with the previous two variants).

BCP 47 is documented in https://www.rfc-editor.org/info/rfc5646/, the Wikipedia entry is pretty readable, https://en.wikipedia.org/wiki/IETF_language_tag.

Language subtags are registered in https://www.iana.org/assignments/language-subtag-registry/language-subtag-registry, which has the following entry for Valencia:

Type: variant
Subtag: valencia
Description: Valencian
Added: 2007-03-06
Prefix: ca
Comments: Variety spoken in the "Comunidad Valenciana" region of Spain,
  where it is co-official with Spanish.

Putting that together, the directory for Valencian language resources should be:

values-b+ca+valencia

nikclayton avatar Nov 06 '26 15:11 nikclayton

Thank you for your report — the issue has now been resolved.

The fix has been merged into the repository and will be included in the upcoming Weblate 2026.12 release.

  • If you encounter any issues with the fix, please comment in this thread.
  • If you experience a similar but separate issue, open a new report so we can track it properly.
  • If you find Weblate helpful, consider supporting its development.

github-actions[bot] avatar Nov 27 '26 12:11 github-actions[bot]