-
Notifications
You must be signed in to change notification settings - Fork 65
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
OHRI-1841 Include new OHRI instance for default locale, Mock forms #123
Conversation
const { t, i18n } = useTranslation('ohri', { i18n: i18next }); | ||
const valueTranslated = t('value', value); | ||
|
||
//TODO: Missing button for component change language instead of default language |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My understanding is that the form-engine should not introduce any button but use what is defined by the app, I believe we have a language switcher button somewhere in O3.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And even if we decided to add a button it would not be at the label level but rather at the form level
@@ -0,0 +1,53 @@ | |||
import htsPT from './hts_pre_test_DRAFT.PT.json'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe you had these HTS forms for testing purposes when you were developing but I don't think they should be added to the repo. Please remove
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove this file
|
||
type LabelProps = { | ||
value: string; | ||
tooltipText?: string; | ||
}; | ||
|
||
export const OHRILabel: React.FC<LabelProps> = ({ value, tooltipText }) => { | ||
const { t, i18n } = useTranslation('ohri', { i18n: i18next }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Am not sure if the key ohri
was meant to imply something specific but i believe we should opt for more generic names and not organization specific naming.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is an existing i18n instance, I was not able to override to reference the forms.
So, within it does not lookUp forms resources that has subforms with locale.
We can see together how to override that.
@@ -0,0 +1,133 @@ | |||
{ | |||
"name": "HTS Pre-Test Counselling", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if i missed a reference to these json files but these should be removed if not needed along other unused json files
src/components/translator/fr.json
Outdated
"finalSchema": "Schéma Final", | ||
"formIntent": "Intention du Formulaire", | ||
"formRender": "Rendu du Formulaire", | ||
"formRenderMenuLink": "Rendu du Formulaire", | ||
"formRenderTestTitle": "Test de Rendu du Formulaire", | ||
"generatedForm": "Formulaire Généré", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some of these keys are are not essential to the form engine but rather other esms, in this case Form Render
we so some clean up of this
const resources = { | ||
pt: { ohri: ptTranslation }, | ||
fr: { ohri: frTranslation }, | ||
en: { ohri: enTranslation }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This key will have to be changed based off the previous comment about organization specific naming
Closing as this has become stale and needs to be reworked |
Requirements
Summary
A translation new instance to refer the OHRI Forms and detect cliet browser default language, and translate Form labels to default language.
Screenshots
Related Issue
Other