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

Vue i18n POC #167

Closed
wants to merge 7 commits into from
Closed

Vue i18n POC #167

wants to merge 7 commits into from

Conversation

mhelmetag
Copy link
Contributor

@mhelmetag mhelmetag commented Sep 1, 2020

Context

Just toying around with Vue i18n to see if that would work for internationalization. Seems like it would do the trick for a relatively simple web app like this one.

Thoughts?

I haven't played around with Vue much so I'm definitely open to trying other less Vue specific i18n solutions.

In this screenshot, there's basically no change but... the "Watchfaces" and "Apps" texts are using the "en" translation strings instead of static strings in the template.
Screen Shot 2020-09-01 at 12 12 15 AM

Testing

  • Navbar
  • AppSlider
  • AppTitleBar
  • CardCollection
  • GetAppButton

@mhelmetag mhelmetag mentioned this pull request Sep 1, 2020
10 tasks
@sGerli
Copy link
Member

sGerli commented Sep 4, 2020

We could try extracting the translations from https://github.com/pebble-dev/pebble-appstore-legacy/tree/master/spa
Or we could write our own for at least those locales.

@mhelmetag
Copy link
Contributor Author

Oh rad! That's a great place to start. I'll take a look soon.

@mhelmetag
Copy link
Contributor Author

mhelmetag commented Sep 6, 2020

Yikes... these script files are crazy! It looks like the whole minified app for each locale.

So... I think it's lucky that the i18n info is in a service.strings thing which is easily searchable and then, when extracted by itself into JS, easily formattable. That said... I'm not sure how to evaluate this blob and extract these programmatically but it's only about 10 locales so it's not hard to do.

I think the "hard" part will be matching up the translations in the legacy app with the string in the new app. Luckily I only see about 100 strings (and I doubt we implement all of them) so... can't be terrible. I'll try to go through it for English first.

@mhelmetag
Copy link
Contributor Author

So I've found a couple of strings that don't seem to be in the legacy pebble app so I think those will have to be translated on our own.

@sGerli
Copy link
Member

sGerli commented Sep 6, 2020

Yeah sure, I think the best way is to do it manually and then figure out the keys using the english version. Then check what we need and take what's useful and check if anything on our web-app needs to be changed or translated because it's different from what we have.

@mhelmetag mhelmetag marked this pull request as ready for review September 16, 2020 06:03
@mhelmetag
Copy link
Contributor Author

mhelmetag commented Sep 16, 2020

I think this is a pretty good example of a common locale file, individual component locales, interpolation in locale strings and locales in directive attributes (not really sure if that's that's the right phrase; I mean things like ok-title="Blah" but having a translation function in there like ok-title="$t('blah')").

IMO, I think this a good place to start and we can iterate on this. I might just need help testing all components here.

@mhelmetag
Copy link
Contributor Author

@sGerli , are you thinking that this PR should have all english strings put into i18n before merging? Or even more than that?

@mhelmetag
Copy link
Contributor Author

Well... it was fun but this doesn't seem to be getting much traction so... I'll close this out for now.

@mhelmetag mhelmetag closed this Dec 30, 2020
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.

None yet

2 participants