FilterLists icon indicating copy to clipboard operation
FilterLists copied to clipboard

globalization

Open DandelionSprout opened this issue 7 years ago • 4 comments

Before I went almost all-in on adblocking projects as far as my GitHub activities went, I was a very prolificent translator of PC and Android apps, mostly from English to Norwegian, and have more than 50 translation projects (Not all of them on GitHub) under my belt.

So not only would I have been honoured if I became able to translate FilterLists.com to Norwegian, but I can see that there's currently very few things (≥39 strings) on the website that'd need to be translated, such that a somewhat experienced translator could've done it in 15 minutes:

The independent, comprehensive directory of $value1$ unique rules across $value2$ filter and host lists for advertisements, trackers, malware, and annoyances.
Name
Software Support
Tags
Language:
Languages
Updated
Details
Discontinued:
License:
Subscribe
View
Home
Rule Count
Donate
By $name$
Page $value1$ of $value2$
Maintained by $name$
More by $name$:
GH Issues
Email
Any
(And the 17-ish tag names)

I run on the assumption that some things can be cheesed, such as by gathering translations of language names from some sort of web database. Though if that can't be done, it'd still mean merely 36 extra strings. Also, the placeholders above (e.g. $name$) are merely placeholders of placeholders, as odd as it may sound.

I do however acknowledge that it'd be no small feat to adjust the site's coding to make its text strings support multiple languages. Setting up a translation service (e.g. Crowdin, Transifex, POeditor, Ackuna, Localize.biz, PhraseApp, etc.) would however be merely optional, since the small size of the project would make it fit decently well within the constraints of on-GitHub translating.

DandelionSprout avatar Sep 05 '18 19:09 DandelionSprout

I'm all for this! Localization of an app is something I've never done, and I would love to learn. I don't have any translation experience, nor do I know any other languages besides English (and a bit of Spanish). But, if I could get the plumbing setup with a guide, maybe yourself and others can contribute the translated strings over time.

For the current FilterLists stack, a guide for how I can do it: https://docs.microsoft.com/en-us/aspnet/core/fundamentals/localization?view=aspnetcore-2.1

collinbarrett avatar Sep 05 '18 19:09 collinbarrett

Oh, and as a bonus note:

The dates on the website are currently given as month/day/year (9/5/2018), which is slightly confusing in most of Europe, where day/month/year (5/9/2018) is normally preferred.

There are multiple possible approaches to try to resolve that for users from countries that use non-American date formats, but I can't recommend any specific one of them over the others.

DandelionSprout avatar Sep 05 '18 19:09 DandelionSprout

So, I thought dates should be currently localized properly using Moment.js . But, I haven't actually tried spoofing my locale to test this. See links below:

https://github.com/collinbarrett/FilterLists/blob/3a5a4eae81f63769f8f06e0f50a1e3289d09004f/src/FilterLists.Web/ClientApp/components/Home.tsx#L197 https://momentjs.com/docs/#localized-formats

collinbarrett avatar Sep 05 '18 19:09 collinbarrett

I fall woefully short when it comes to Javascript, but I think there may be missing some kind of query for a user's date format.

So that in the portion with:

Cell: (cell: any) => <div>{moment(cell.value).isValid()
                               ? moment(cell.value).format("l")
                               : "N/A"}</div>,

...there's nothing that tells it to check which date format a user or a user's locale has.

One suggestion I saw on Stack Overflow was to use moment(mydate).format('l');, and there's likely several other methods as well out there.

DandelionSprout avatar Sep 05 '18 20:09 DandelionSprout