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

Add table header translations #923

Merged
merged 4 commits into from
Aug 19, 2021
Merged

Conversation

yen-tt
Copy link
Contributor

@yen-tt yen-tt commented Aug 18, 2021

  • add table header translations for new languages
  • move the code to extract language from locale to utils

TEST=none

@coveralls
Copy link

coveralls commented Aug 18, 2021

Coverage Status

Coverage decreased (-0.02%) to 7.68% when pulling f4213e7 on dev/table-string-translations into 10a2ff6 on develop.

[TableHeaders.DAY_OF_WEEK]: 'Veckodag',
[TableHeaders.HOURS]: 'Timmar'
}
case 'zh-CH':
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're actually in the process of cutting over to 'zh-Hans' and 'zh-Hant'. Turns out, that's what LiveAPI and KG use instead. We want to be consistent with the rest of Yext. You should just be able to update the key names here.

* @returns {string} language
*/
export function getLanguageFromLocale(locale) {
const language = (locale === 'zh-CN' || locale === 'zh-TW')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method will also need to be updated to use the new language codes I mentioned above. I'd also let @cea2aj and @oshi97 know you made this method. I think one of them was working on something similar for a different PR.

Copy link
Contributor Author

@yen-tt yen-tt Aug 19, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see that connor made a parse locale function in his pr. will use it here once that's merge

const language = (locale === 'zh-CN' || locale === 'zh-TW') ?
locale :
locale.substring(0,2);
const language = getLanguageFromLocale(locale);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a PR open for the open status translations (#927) so this isn't needed here

@yen-tt yen-tt merged commit 0907e26 into develop Aug 19, 2021
@yen-tt yen-tt deleted the dev/table-string-translations branch August 19, 2021 15:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants