Info
Requested by Tim Chen
It's been requested of us that we have support for additional languages. Considering we are a multi-language nation, we should probably at the very least be capable of supporting French, but support for other languages should be built in so that later it's easy to add other languages as needed.
Acceptance Criteria:
- Be able to resolve the chosen language
- Do this by accepting a
lang attribute added to the html tag or any other kind of block level tag (div, section, etc....)
- This would be the priority level,
html --> other parent component --> en-CA
- French language would be supported via
fr-CA, fr-FR is another language (France French)
en-CA would be the default language if nothing else is supplied
- Have an interface created with all messages that would need to be translated, such as:
- Similar text shared by models shouldn't be placed in a model specific location so we don't have to duplicate translations
export interface GoaMessages {
pagination: {
page: string;
of: string;
previous: string;
next: string;
};
fileUpload: {
dropFiles: string;
or: string;
browseFiles: string;
maximumFileSize: (size: string) => string;
};
modal: {
label: string;
close: string;
};
}
- Build out the corresponding language files,
en-CA and fr-CA for starters.
- Considering we don't use full sentences, Google Translate should be good enough for this
- Replace all instances of hardcoded text with the message locations
- This includes visual text, and aria text
- Add some examples of localization on the website (
html based, sub level component based, etc...)
DO NOT use localization based on location for things like months and days. That could very easily conflict with the localization provided by the lang attribute as again there is no designated French only location in Canada. Translate months and days, etc... based on the lang attribute like everything else
Info
Requested by Tim Chen
It's been requested of us that we have support for additional languages. Considering we are a multi-language nation, we should probably at the very least be capable of supporting French, but support for other languages should be built in so that later it's easy to add other languages as needed.
Acceptance Criteria:
langattribute added to thehtmltag or any other kind of block level tag (div,section, etc....)html--> other parent component -->en-CAfr-CA,fr-FRis another language (France French)en-CAwould be the default language if nothing else is supplieden-CAandfr-CAfor starters.htmlbased, sub level component based, etc...)DO NOT use localization based on location for things like months and days. That could very easily conflict with the localization provided by the
langattribute as again there is no designated French only location in Canada. Translate months and days, etc... based on thelangattribute like everything else