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

Wikiproject translation missing #9706

Open
cotesta opened this issue Jun 21, 2023 · 1 comment
Open

Wikiproject translation missing #9706

cotesta opened this issue Jun 21, 2023 · 1 comment
Labels
bug A bug - let's fix this! localization Adapting iD across languages, regions, and cultures

Comments

@cotesta
Copy link

cotesta commented Jun 21, 2023

URL

https://www.openstreetmap.org/edit#map=18/39.93830/-81.92419

How to reproduce the issue?

  1. Open OSM website, click edit
  2. Make a change within the state of Ohio (possibly other states involved?)
  3. Upload change, look to the left sidebar
    (still not fixed as of 6/24/2023)

Screenshot(s) or anything else?

WikiProject text is missing its en translation. Should be self-explanatory from screenshot.
osmwikiproj

Which deployed environments do you see the issue in?

Released version at openstreetmap.org/edit

What version numbers does this issue effect?

2.25.2

Which browsers are you seeing this problem on?

Firefox

@1ec5
Copy link
Collaborator

1ec5 commented Jun 25, 2023

This issue also affects a few other resources, such as Code for San José Discord: osmlab/osm-community-index#654.

It appears to be a race condition of sorts. osm-community-index v5.5.3 was released a few days ago, including osmlab/osm-community-index#660. However, there hasn’t been a release of iD since April, so the base English localization file probably doesn’t contain the English text that’s in osm-community-index.

iD does fetch the latest osm-community-index v5.5.x dynamically at runtime to get the freshest list of resources to display:

|| 'https://cdn.jsdelivr.net/npm/osm-community-index@{version}/';
const ociVersion = packageJSON.dependencies['osm-community-index'] || packageJSON.devDependencies['osm-community-index'];
const v = parseVersion(ociVersion);
const ociVersionMinor = `${v.major}.${v.minor}`;

iD/package.json

Line 112 in 446133d

"osm-community-index": "~5.5.2",

However, the translated strings are baked into one of the files in /dist/locales/. In the case of English, the locale file is generated at build time based on whichever osm-community-index version was current at that time:

iD/modules/ui/success.js

Lines 171 to 173 in 446133d

// Resolve strings
const localizer = (stringID) => t.html(`community.${stringID}`);
resource.resolved = resolveStrings(resource, oci.defaults, localizer);
const readCommunity = fs.readFileSync('node_modules/osm-community-index/i18n/en.yaml', 'utf8');

iD/package.json

Line 112 in 446133d

"osm-community-index": "~5.5.2",

I think the success screen needs to use a custom localizer that uses what fileFetcher pulls in. Or maybe the localization file’s community tree needs to be added to this table of trees to fetch dynamically, just like for id-tagging-schema:

const localeDirs = {
general: 'locales',
tagging: presetsCdnUrl + 'dist/translations'
};
let fileMap = fileFetcher.fileMap();
for (let scopeId in localeDirs) {
const key = `locales_index_${scopeId}`;
if (!fileMap[key]) {
fileMap[key] = localeDirs[scopeId] + '/index.min.json';
}
filesToFetch.push(key);
}

@1ec5 1ec5 added bug A bug - let's fix this! localization Adapting iD across languages, regions, and cultures labels Jun 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A bug - let's fix this! localization Adapting iD across languages, regions, and cultures
Projects
None yet
Development

No branches or pull requests

2 participants