-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Settings - Error message is not translated dynamically to Spanish #23008
Comments
ProposalPlease re-state the problem that we are trying to solve in this issue.Error message is not translated dynamically to Spanish What is the root cause of that problem?all errors text is translated once and saved to state, so when language is changed the state not translate again. App/src/components/AvatarWithImagePicker.js Lines 197 to 201 in 6e5b07c
What changes do you think we should make in order to solve the problem?we should save // state
this.state = {
errorModalPromptTranslationKey: '',
errorModalTitleTranslationKey: '',
};
showErrorModal(titleTranslationKey, promptTranslationKey) {
this.setState({isErrorModalVisible: true, errorModalTitleTranslationKey: titleTranslationKey, errorModalPromptTranslationKey: promptTranslationKey});
}
this.showErrorModal(
// this.props.translate('avatarWithImagePicker.imageUploadFailed')
'avatarWithImagePicker.imageUploadFailed',
...
);
<ConfirmModal
title={Boolean(this.state.errorModalTitleTranslationKey) ? props.translate(this.state.errorModalTitleTranslationKey) : ''}
prompt={Boolean(this.state.errorModalPromptTranslationKey) ? props.translate(this.state.errorModalPromptTranslationKey) : ''}
We need to do the same for all error type in this component What alternative solutions did you explore? (Optional)we can search for similar cases like this and also fix it. |
Triggered auto assignment to @kevinksullivan ( |
Bug0 Triage Checklist (Main S/O)
|
ProposalPlease re-state the problem that we are trying to solve in this issue.When we upload an unsupported file in profile picture an error modal appears. But its title and prompt do not change on changing language from another device What is the root cause of that problem?Root cause of the problem is in the showAvatarCropModal(image) {
if (!this.isValidExtension(image)) {
this.showErrorModal(
this.props.translate('avatarWithImagePicker.imageUploadFailed'),
this.props.translate('avatarWithImagePicker.notAllowedExtension', {allowedExtensions: CONST.AVATAR_ALLOWED_EXTENSIONS}),
); Here we are translating it in the functions like this. So these do not get translated dynamically when language is changed from another device. What changes do you think we should make in order to solve the problem?We can observe that the word close is translated properly. showErrorModal(title, prompt, reason) {
this.setState({isErrorModalVisible: true, errorModalTitle: title, errorModalPrompt: prompt, reason});
} and showAvatarCropModal(image) {
if (!this.isValidExtension(image)) {
this.showErrorModal(
'avatarWithImagePicker.imageUploadFailed',
'avatarWithImagePicker.notAllowedExtension',
{allowedExtensions: CONST.AVATAR_ALLOWED_EXTENSIONS}
); and translate it in the render statement like this <ConfirmModal
title={this.state.errorModalTitle ? this.props.translate(this.state.errorModalTitle, this.state.reason) : ‘’}
onConfirm={this.hideErrorModal}
onCancel={this.hideErrorModal}
isVisible={this.state.isErrorModalVisible}
prompt={this.state.errorModalTitle ? this.props.translate(this.state.errorModalPrompt, this.state.reason) : ‘’}
confirmText={this.props.translate('common.close')}
shouldShowCancelButton={false}
/> We change similarly at other Further there are other files like What alternative solutions did you explore? (Optional) |
@kevinksullivan would love your thoughts on this - I think this issue and this are pretty edge case behavior (changing your language in the middle of taking an action, I don't see a lot of users doing that) but if it's the same root cause I think we should keep one issue open and fix |
Let's keep your issue if it was opened first @adelekennedy . FWIW many of our bugs are edge cases, but I'd agree that this is not the behavior I'd expect so I'd consider it a bug. |
If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!
Action Performed:
Expected Result:
Error message should be translated dynamically to Spanish
Actual Result:
Error message is not translated dynamically to Spanish
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Version Number: 1.3.40-5
Reproducible in staging?: y
Reproducible in production?: y
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos: Any additional supporting documentation
24.New.Expensify.-.16.July.2023.1.mp4
Screen_Recording_20230717_111243_Chrome.mp4
Recording.3697.mp4
Expensify/Expensify Issue URL:
Issue reported by: @mejed-alkoutaini
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1689465033493809
View all open jobs on GitHub
The text was updated successfully, but these errors were encountered: