DominicMaas / TimelineExtension

Windows Timeline & Project Rome Web Extension
MIT License
482 stars 27 forks source link

Translation #64

Closed DominicMaas closed 6 years ago

DominicMaas commented 6 years ago

Ideas for translating the extension.

dwm1909 commented 6 years ago

Where would you like to have the _locales maps? where you add like en/file.json and se/file.json the manifest.json also need include a standard lang like "default_locale": "en",

and a map where you want all the lang files to be added to.

DominicMaas commented 6 years ago

There's a whole page about it here: https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Internationalization.

Probably in the extension folder somewhere, I'll start work on it.

dwm1909 commented 6 years ago

Never create a firefox extention before but have create alot for Chrome, i can create the strings just need a map like _locales where you can create like another map with en/file.json

So its become like

_locales/en/file.json - English _locales/sv/file.json - Swedish

have include like en as a standard string into the manifest as far. working just now with the strings for manifest info.

DominicMaas commented 6 years ago

Okay, I'll add the script that will automatically inject the translations into HTML pages.

dwm1909 commented 6 years ago

Here is some exempel so far

{ "Name": { "message": "Timeline Support", "description": "Automatically sync your browsing history to your Windows 10 PC with Windows Timeline. Push active websites to any of your devices." }, "TimelineDescription": { "message": "Timeline Support", "description":"Automatically sync your browsing history to your Windows 10 PC with Windows Timeline. Push active websites to any of your devices." } }

"name": "MSG_Name", "description": "MSG_TimelineDescription", "default_locale": "en",

after Name its dosent show __ and TimelineDescription

DominicMaas commented 6 years ago

Do you want me to update the files, or are you going to create a pull request?

dwm1909 commented 6 years ago

I did just downloads the pack and change .ts to .js for build a local test for some resonen i dont get the login to work, so i can try to update the apps with the lang stuff and strings for try them local before make any changes.

Did only pick the Scripts and the Extention maps is any other files am need to have?

dwm1909 commented 6 years ago

Have got it to work so upload some changes so its only to create more strings left to do.

DominicMaas commented 6 years ago

I've merged the changes (unable to check if it works though).

dwm1909 commented 6 years ago

I have the Swedish translate so its changed frome English to Swedish the small number of translate done so far.

dwm1909 commented 6 years ago

For some reason, HTML files do not seem to be able to read the strings

DominicMaas commented 6 years ago

Don't worry about that for now. I'll do it. (I still have to test the script and modify it to make it work).

dwm1909 commented 6 years ago

The strings into HTML only can reload by JavaScript as far i know later by the strings, should i create the strings and copy all data after its just need to make changes with strings name with javascripts?

DominicMaas commented 6 years ago

I'm in the process of moving all the strings now (and I have the HTML part working). Don't worry about anything till I have the commits published.

DominicMaas commented 6 years ago

I've pushed the changes. Keep in mind that you will have to rebuild the scripts npm run build if you want the HTML to be updated.

dwm1909 commented 6 years ago

If you put into the strings into the html i guess i dont need to rebuild it just translate the English to Swedish part, or just pick out the changes some need. Will take a look with you changes see what some need to do :)

This happens becouse they html file dosent use the string frome i18n i18n is for html, css and files like this. https://developer.chrome.com/extensions/i18n

i18n

But here is also diffrens frome Chrome to Firefox also need controll of with broswer some is in use.

DominicMaas commented 6 years ago

It only has to be re-built once (to ensure the new scripts work).

dwm1909 commented 6 years ago

has rebuild the files some has ben changed alredy.

But HTML can not use like this

__MSG__ExtensionName__

You need JavaScript some reload the information into the HTML files becouse HTML gonna just write MSGExtensionName__ and not the information into the _locales/en/messages.json

This part need JavaScript handling only .js and manifest can handling the change with out any javascript.

OMG i think i forgot rebuild the .js files as well

DominicMaas commented 6 years ago

That's what this file does. It loops though the HTML, replacing __MSG__ExtensionName__ with the content in _locales/en/messages.json. Confirmed to work on Firefox (Ubuntu), is it not working on Chrome?

dwm1909 commented 6 years ago

Have try rebuild it but still the same issues, gonna try rebuild the whole pack again frome the ground, problie missing something at this point of day time :)

Complete rebuild is the same as the images over its dosent become text just strings

Can not find https://github.com/DominicMaas/TimelineExtension/blob/master/src/scripts/common/helpers.ts this file as a .js file into the html file.

See its handling by the menu.js files now, but dosent help for some reason

DominicMaas commented 6 years ago

When you run npm run build it will combine all the *.ts files into a *.js file.

dwm1909 commented 6 years ago

Alredy have it into .js its not that the issues is is just that looks like its dosent handling the i18n trying too look at it find it but my eyes start to falling down.

DominicMaas commented 6 years ago

Just tested on Chrome and it works on my end.

dwm1909 commented 6 years ago

See the GitHub Desktop app dosent get the latest updated now its problie why not working for me when i do a copy frome the dekstop client, open the se file for see if the latest was there and still the old files.

Relly start to be sleepy so missing simpel stuff like that, will try later :) trying to refresh and reopen it see when its start to be updated.

use a swedish Chrome so accept the sv lang files so i dont have missing strings and text frome the sv/

DominicMaas commented 6 years ago

Since translation is now setup, I'll close this issue. Any new translations can just be submitted via a pull request (I'll update the readme)