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 support for internationalization #59

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

regisrob
Copy link

No description provided.

const bounds = this.currentBounds();
return `Zoomed region (${Math.floor(bounds.width)} x ${Math.floor(bounds.height)}px)`;
return `${t('zoomed_region')} (${Math.floor(bounds.width)} x ${Math.floor(bounds.height)}px)`;
Copy link
Contributor

Choose a reason for hiding this comment

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

We'll probably want to i18n the whole pattern here and below (especially for RTL languages, where the order might be different). I think the javascript i18next library does some fancy things with interpolation, maybe something like:

t('download_link', { name: '{{zoomed_region}}', width: Math.floor(bounds.width), height: Math.floor(bounds.height) })

https://www.i18next.com/translation-function/interpolation

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.

2 participants