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

Ensure ISO code 'nb' becomes wiki language code 'no' within the app #3909

Merged
merged 2 commits into from Apr 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 7 additions & 3 deletions WMF Framework/MWKDataStore+LanguageVariantMigration.swift
Expand Up @@ -52,9 +52,13 @@ extension MWKDataStore {
result[languageCode] = languageVariantCode
}

languageLinkController.migratePreferredLanguages(toLanguageVariants: migrationMapping, in: moc)
feedContentController.migrateExploreFeedSettings(toLanguageVariants: migrationMapping, in: moc)
migrateSearchLanguageSetting(toLanguageVariants: migrationMapping)
// Ensure any settings that currently use 'nb' are updated to use 'no'
var languageCodeMigrationMapping = migrationMapping
languageCodeMigrationMapping["nb"] = "no"

languageLinkController.migratePreferredLanguages(toLanguageVariants: languageCodeMigrationMapping, in: moc)
feedContentController.migrateExploreFeedSettings(toLanguageVariants: languageCodeMigrationMapping, in: moc)
migrateSearchLanguageSetting(toLanguageVariants: languageCodeMigrationMapping)
migrateWikipediaEntities(toLanguageVariants: migrationMapping, in: moc)
}

Expand Down
5 changes: 5 additions & 0 deletions WMF Framework/MediaWikiAcceptLanguageMapping.json
Expand Up @@ -79,5 +79,10 @@
"latn": {
"default": "uz-latin",
}
},
"nb": {
"default": {
"default": "no",
}
}
}
2 changes: 1 addition & 1 deletion Wikipedia/Code/MWKLanguageLink.m
Expand Up @@ -55,7 +55,7 @@ - (NSString *)description {
@"%@ { \n"
"\tlanguageCode: %@, \n"
"\tlanguageVariantCode: %@, \n"
"\altISOCode: %@, \n"
"\taltISOCode: %@, \n"
"\tpageTitleText: %@, \n"
"\tname: %@, \n"
"\tlocalizedName: %@ \n"
Expand Down