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

Serbian preset info from iD is not being pulled in #3897

Closed
matkoniecz opened this issue Mar 20, 2022 · 3 comments
Closed

Serbian preset info from iD is not being pulled in #3897

matkoniecz opened this issue Mar 20, 2022 · 3 comments
Assignees
Labels

Comments

@matkoniecz
Copy link
Member

That is because bcp47ExportLanguages has it defined as sr-cyrl while iD presets use sr and is skipped in

if (exportLangs != null && !exportLangs.contains(language)) continue

See https://www.transifex.com/openstreetmap/id-editor/language/sr/ - presets are fully translated

missing from https://github.com/streetcomplete/StreetComplete/tree/master/app/src/main/assets/osmfeatures/default

Maybe this and Norwegian should rather use modified https://github.com/streetcomplete/StreetComplete/blob/6aca0dc9476034466d04949ffe870075932edb96/buildSrc/src/main/java/Utils.kt

@matkoniecz matkoniecz added the bug label Mar 20, 2022
matkoniecz added a commit to matkoniecz/Zazolc that referenced this issue Mar 20, 2022
@matkoniecz matkoniecz self-assigned this Mar 20, 2022
matkoniecz added a commit to matkoniecz/Zazolc that referenced this issue Mar 20, 2022
matkoniecz added a commit to matkoniecz/Zazolc that referenced this issue Mar 20, 2022
@HolgerJeromin
Copy link
Contributor

IMO we should split both language strings at "-" and try to match the first part if the exact string is not found.
That way this would be more generic

@matkoniecz
Copy link
Member Author

matkoniecz commented Mar 20, 2022

@westnordost - why in javaLanguageTagToAndroidResCodes ( https://github.com/streetcomplete/StreetComplete/blob/6aca0dc9476034466d04949ffe870075932edb96/buildSrc/src/main/java/Utils.kt ) there is if (languageTag == "zh-CN") return listOf("zh")?

From what I see zh-CN is actually using zh-CN files, at least for iD presets.


First part, needed to obtain iD preset data is in matkoniecz@01d9537

I am tempted to add just one more kludge and move sr-Cyrl to sr in

open class UpdatePresetsTask : DefaultTask() {

IMO we should split both language strings at "-" and try to match the first part if the exact string is not found.

This could be accomplished by simply using already existing javaLanguageTagToAndroidResCodes in UpdatePresetsTask

val javaLanguage = bcp47LanguageTagToJavaLanguageTag(language)
File("$targetDir/$javaLanguage.json").writeText(presetsLocalization)

could be using javaLanguageTagToAndroidResCodes as extra tranformation step.

But I am not sure about potential side-effects.

@westnordost
Copy link
Member

I also noticed that osmfeatures had support for scripts (e.g. "bg-Cyrl" missing). Fixed that and v4.1.

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

No branches or pull requests

3 participants