-
Notifications
You must be signed in to change notification settings - Fork 42
Description
The current structure of the tutorialStrings object in the mei-tutorials.js file is a two-level nested object where the first level keys are language codes ('EN', 'ES', etc.) and the second level keys are string identifiers ('codeNotWellformed', 'fetchOperationProblem', etc.). While this structure is clear and easy to understand, it could be improved for better scalability and maintainability.
CWe should consider refactoring the tutorialStrings object to a structure where each key is a string identifier and its value is another object that maps language codes to their translations. This would make it easier to add new languages or new strings in the future.
Current structure:
var tutorialStrings = {
'EN': {
'codeNotWellformed': 'Your code is not well-formed.',
'fetchOperationProblem': There has been a problem with the fetch operation for:',
// ...other strings...
},
'ES': {
'codeNotWellformed': 'Su código no está bien formado.',
'fetchOperationProblem': 'Ha habido un problema con la operación fetch para:'
// ...other strings...
}
// ...other languages...
};Proposed structure:
var tutorialStrings = {
'codeNotWellformed': {
'EN': 'Your code is not well-formed.',
'ES': 'Su código no está bien formado.'
},
'fetchOperationProblem': {
'EN': 'There has been a problem with the fetch operation for:',
'ES': 'Ha habido un problema con la operación fetch para:'
},
// ...and so on for the rest of the strings
};With this structure it is easier to add new laguages or strings.
Instead of using tutorialStrings[LANG][stringId], we would then use tutorialStrings[stringId][LANG] to get the correct value.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status