Git Product home page Git Product logo

Comments (8)

flodolo avatar flodolo commented on July 26, 2024 1

@pdehaan
Going to close, let me know if you have any question ;-)

P.S. I've changed the linter to also ignore the <br> tag, since it might make sense to add or remove line breaks in localization.

from fxa-content-server-l10n.

flodolo avatar flodolo commented on July 26, 2024

I raise to 114 issues…

I'm working on a WIP of a linter of my own. Looks like at least one string (main.ftl:payment-confirm) was migrated completely broken (see fix for Italian), and might actually be obsolete. It would be great for that team to check how many obsolete strings we have in that file :-|

Locale: ar (2)
  placeable missing in Fluent string (auth.ftl:fxa-privacy-url)
  placeable mismatch in Fluent string (auth.ftl:fxa-service-url)
Locale: ast (1)
  placeable mismatch in Fluent string (auth.ftl:verificationReminderFirst-description)
Locale: az (2)
  placeable mismatch in Fluent string (auth.ftl:fxa-service-url)
  placeable mismatch in Fluent string (auth.ftl:verificationReminderFirst-description)
Locale: bn (1)
  placeable mismatch in Fluent string (auth.ftl:verificationReminderFirst-description)
Locale: cs (1)
  Mismatched HTML elements in string (main.ftl:account-activated)
Locale: cy (8)
  Mismatched HTML elements in string (main.ftl:payment-legal-link-stripe-paypal)
  Mismatched HTML elements in string (main.ftl:payment-confirm-with-legal-links-day)
  Mismatched HTML elements in string (main.ftl:payment-confirm-with-legal-links-week)
  Mismatched HTML elements in string (main.ftl:payment-confirm-with-legal-links-month)
  Mismatched HTML elements in string (main.ftl:payment-confirm-with-legal-links-year)
  Mismatched HTML elements in string (main.ftl:payment-confirm)
  placeable missing in Fluent string (settings.ftl:auth-error-114)
  placeable missing in Fluent string (auth.ftl:unblockCode-prompt-plaintext)
Locale: de (1)
  Mismatched HTML elements in string (main.ftl:payment-confirm)
Locale: dsb (1)
  placeable mismatch in Fluent string (auth.ftl:postAddLinkedAccount-title)
Locale: el (1)
  Mismatched HTML elements in string (main.ftl:payment-confirm)
Locale: en_CA (1)
  Mismatched HTML elements in string (main.ftl:payment-confirm)
Locale: es (1)
  placeable mismatch in Fluent string (auth.ftl:verificationReminderFirst-description)
Locale: es_AR (5)
  Mismatched HTML elements in string (main.ftl:payment-confirm)
  Mismatched HTML elements in string (main.ftl:sub-route-idx-cancel-msg)
  Mismatched HTML elements in string (settings.ftl:verify-secondary-email-please-enter-code)
  placeable mismatch in Fluent string (main.ftl:reactivate-confirm-without-payment-method-copy)
  placeable missing in Fluent string (settings.ftl:verify-secondary-email-please-enter-code)
Locale: es_CL (3)
  Mismatched HTML elements in string (settings.ftl:connect-another-find-fx-mobile)
  Mismatched HTML elements in string (settings.ftl:tfa-scan-this-code)
  Mismatched HTML elements in string (auth.ftl:subplat-manage-account)
Locale: es_ES (1)
  Mismatched HTML elements in string (settings.ftl:tfa-scan-this-code)
Locale: es_MX (1)
  Mismatched HTML elements in string (settings.ftl:tfa-scan-this-code)
Locale: et (2)
  placeable mismatch in Fluent string (auth.ftl:subscriptionDowngrade-content-charge-info)
  placeable mismatch in Fluent string (auth.ftl:subscriptionUpgrade-content-charge-info)
Locale: ff (1)
  placeable mismatch in Fluent string (auth.ftl:verificationReminderFirst-description)
Locale: fi (2)
  Mismatched HTML elements in string (main.ftl:payment-confirm)
  placeable missing in Fluent string (auth.ftl:subscriptionRenewalReminder-subject)
Locale: fy (6)
  Mismatched HTML elements in string (main.ftl:payment-confirm-with-legal-links-day)
  Mismatched HTML elements in string (main.ftl:payment-confirm-with-legal-links-week)
  Mismatched HTML elements in string (main.ftl:payment-confirm-with-legal-links-month)
  Mismatched HTML elements in string (main.ftl:payment-confirm-with-legal-links-year)
  Mismatched HTML elements in string (main.ftl:payment-confirm)
  Mismatched HTML elements in string (settings.ftl:mvs-enter-verification-code-desc)
Locale: fy_NL (6)
  Mismatched HTML elements in string (main.ftl:payment-confirm-with-legal-links-day)
  Mismatched HTML elements in string (main.ftl:payment-confirm-with-legal-links-week)
  Mismatched HTML elements in string (main.ftl:payment-confirm-with-legal-links-month)
  Mismatched HTML elements in string (main.ftl:payment-confirm-with-legal-links-year)
  Mismatched HTML elements in string (main.ftl:payment-confirm)
  Mismatched HTML elements in string (settings.ftl:mvs-enter-verification-code-desc)
Locale: gd (1)
  placeable mismatch in Fluent string (auth.ftl:verificationReminderFirst-description)
Locale: gn (3)
  Mismatched HTML elements in string (main.ftl:payment-confirm)
  placeable mismatch in Fluent string (auth.ftl:subscriptionDowngrade-content-charge-info)
  placeable mismatch in Fluent string (auth.ftl:subscriptionUpgrade-content-charge-info)
Locale: he (1)
  placeable mismatch in Fluent string (auth.ftl:subscriptionDowngrade-content-charge-info)
Locale: hi (2)
  placeable mismatch in Fluent string (auth.ftl:fxa-service-url)
  placeable mismatch in Fluent string (auth.ftl:verificationReminderFirst-description)
Locale: hi_IN (2)
  placeable mismatch in Fluent string (auth.ftl:fxa-service-url)
  placeable mismatch in Fluent string (auth.ftl:verificationReminderFirst-description)
Locale: hsb (1)
  placeable mismatch in Fluent string (auth.ftl:postAddLinkedAccount-title)
Locale: hu (2)
  Mismatched HTML elements in string (auth.ftl:automated-email)
  data-l10n-name missing in Fluent string (auth.ftl:automated-email)
Locale: ia (6)
  Mismatched HTML elements in string (main.ftl:payment-confirm)
  Mismatched HTML elements in string (settings.ftl:mvs-enter-verification-code-desc)
  placeable mismatch in Fluent string (main.ftl:payment-confirm-with-legal-links-day)
  placeable mismatch in Fluent string (main.ftl:payment-confirm-with-legal-links-week)
  placeable mismatch in Fluent string (main.ftl:payment-confirm-with-legal-links-month)
  placeable mismatch in Fluent string (main.ftl:payment-confirm-with-legal-links-year)
Locale: id (5)
  Mismatched HTML elements in string (main.ftl:payment-confirm-with-legal-links-day)
  Mismatched HTML elements in string (main.ftl:payment-confirm-with-legal-links-week)
  Mismatched HTML elements in string (main.ftl:payment-confirm-with-legal-links-month)
  Mismatched HTML elements in string (main.ftl:payment-confirm-with-legal-links-year)
  Mismatched HTML elements in string (main.ftl:payment-confirm)
Locale: ka (3)
  placeable mismatch in Fluent string (main.ftl:payment-confirm-with-legal-links-year)
  placeable missing in Fluent string (auth.ftl:subscriptionRenewalReminder-content-greeting)
  placeable missing in Fluent string (auth.ftl:subscriptionRenewalReminder-content-signature)
Locale: kab (5)
  Mismatched HTML elements in string (main.ftl:payment-confirm-with-legal-links-day)
  Mismatched HTML elements in string (main.ftl:payment-confirm-with-legal-links-week)
  Mismatched HTML elements in string (main.ftl:payment-confirm-with-legal-links-month)
  Mismatched HTML elements in string (main.ftl:payment-confirm-with-legal-links-year)
  Mismatched HTML elements in string (main.ftl:payment-confirm)
Locale: kn (1)
  placeable missing in Fluent string (auth.ftl:fxa-privacy-url)
Locale: ko (1)
  placeable mismatch in Fluent string (main.ftl:payment-confirm)
Locale: lt (2)
  placeable missing in Fluent string (auth.ftl:fxa-privacy-url)
  placeable mismatch in Fluent string (auth.ftl:verificationReminderFirst-description)
Locale: ml (1)
  placeable missing in Fluent string (auth.ftl:fxa-privacy-url)
Locale: nb_NO (1)
  Mismatched HTML elements in string (main.ftl:payment-confirm)
Locale: nn_NO (2)
  Mismatched HTML elements in string (main.ftl:payment-confirm-with-legal-links-week)
  Mismatched HTML elements in string (main.ftl:payment-confirm)
Locale: pl (1)
  Mismatched HTML elements in string (main.ftl:payment-confirm)
Locale: pt (1)
  Mismatched HTML elements in string (main.ftl:payment-confirm)
Locale: pt_PT (1)
  Mismatched HTML elements in string (main.ftl:payment-confirm)
Locale: rm (2)
  placeable mismatch in Fluent string (main.ftl:payment-confirmation-cc-card-ending-in)
  placeable mismatch in Fluent string (auth.ftl:fxa-service-url)
Locale: ro (3)
  Mismatched HTML elements in string (main.ftl:payment-confirm-with-legal-links-week)
  placeable mismatch in Fluent string (auth.ftl:passwordChangeRequired-sign-in)
  placeable mismatch in Fluent string (auth.ftl:verificationReminderFirst-description)
Locale: sl (4)
  placeable missing in Fluent string (settings.ftl:dc-subheader)
  placeable missing in Fluent string (settings.ftl:dc-opt-in-success)
  placeable missing in Fluent string (auth.ftl:fxa-privacy-url)
  placeable missing in Fluent string (auth.ftl:subplat-privacy-policy)
Locale: sq (1)
  Mismatched HTML elements in string (main.ftl:payment-confirm)
Locale: sr (1)
  placeable mismatch in Fluent string (auth.ftl:verificationReminderFirst-description)
Locale: sr_Latn (1)
  placeable mismatch in Fluent string (auth.ftl:verificationReminderFirst-description)
Locale: su (2)
  placeable mismatch in Fluent string (auth.ftl:passwordChangeRequired-sign-in)
  placeable mismatch in Fluent string (auth.ftl:verificationReminderFirst-description)
Locale: sv (1)
  Mismatched HTML elements in string (main.ftl:payment-confirm)
Locale: sv_SE (1)
  Mismatched HTML elements in string (main.ftl:payment-confirm)
Locale: ta (1)
  placeable missing in Fluent string (auth.ftl:fxa-privacy-url)
Locale: th (1)
  placeable mismatch in Fluent string (auth.ftl:verificationReminderFirst-description)
Locale: tr (1)
  data-l10n-name mismatch in Fluent string (auth.ftl:body-ios-badge)
Locale: uk (2)
  Mismatched HTML elements in string (main.ftl:payment-confirm)
  Mismatched HTML elements in string (settings.ftl:mvs-enter-verification-code-desc)
Locale: ur (1)
  placeable mismatch in Fluent string (auth.ftl:verificationReminderFirst-description)
Locale: vi (1)
  placeable mismatch in Fluent string (auth.ftl:subscriptionDowngrade-content-charge-info)
Locale: zh_CN (1)
  Mismatched HTML elements in string (main.ftl:payment-confirm)
Locale: zh_TW (1)
  Mismatched HTML elements in string (main.ftl:payment-confirm)

Total errors: 114

from fxa-content-server-l10n.

pdehaan avatar pdehaan commented on July 26, 2024

Rad!
Yeah, I had it on my todo list to talk you about ftl linting, so this is exactly what I was looking for. ❤️
I ended up re-rewriting an old .ftl linting tool I had from the Monitor days that was trying to compare placeables and variables and all that jazz, but then I always get lost on edge cases in some European languages w/ variants. Or else getting too many false positives where strings just aren't translated yet.

But now I'll have to try checking your results vs my results and seeing where we're different.
I only found 106 issues.
You found 114 issues.

So on the surface it looks like you're 8 strings better than me.
But I think my cheap HTML linter solution caught 45 issues w/ weird <a> pair mismatches due to #561. But if your script didn't catch that edge edge case of bonus )s, then that means you're about 53 strings better than me. 🎉

Looking at your results, my script above or my FTL linter wouldn't have caught https://pontoon.mozilla.org/ur/firefox-accounts/auth.ftl/?search=verificationReminderFirst-description&string=235641. Although I think I caught a bunch of these when I was manually reporting everything that Pontoon marked as a "WARNING", although I oddly didn't leave a comment on this one. I think I tried changing it myself, but then got scared off when my hyphens were appearing backwards due to RTL-ness and I panicked.

from fxa-content-server-l10n.

flodolo avatar flodolo commented on July 26, 2024

But I think my cheap HTML linter solution caught 45 issues w/ weird <a> pair mismatches due to #561. But if your script didn't catch that edge edge case of bonus )s, then that means you're about 53 strings better than me. 🎉

Yeah, it wouldn't catch it. It looks for:

  • Mismatched or missing placeable (message/term references, variables)
  • Mismatched data-l10n-name
  • Mismatched HTML tags (not what's inside, or attributes, since in Fluent you shouldn't have those)
  • A few other things, like the pilcrow character in translations, or the ID repeated (these were caused by a couple of bugs in Pontoon)

from fxa-content-server-l10n.

flodolo avatar flodolo commented on July 26, 2024

I think I tried changing it myself, but then got scared off when my hyphens were appearing backwards due to RTL-ness and I panicked.

I almost never touch RTL strings. If I do, I copy them in a text editor first, which seems a bit more intuitive. Note that there might be an "account" hidden there, hence the "brand-firefox (+ account)" instead of brand-firefox-account

from fxa-content-server-l10n.

pdehaan avatar pdehaan commented on July 26, 2024

Yeah, your script is really great!

Locale: gn (3)
  placeable mismatch in Fluent string (auth.ftl:subscriptionDowngrade-content-charge-info)

I had to tweak the URL for /gn/, then search for that id in auth.ftl. But then I can copy out the reference/EN string and the GN string and compare placeables and it turns out the translation was missing { $productPaymentCycleNew }. But that string has a lot of variables, so I had to copy them into VS Code and sort the placeables since I wasn't able to see which one we were missing in the translation.

from fxa-content-server-l10n.

flodolo avatar flodolo commented on July 26, 2024

Side note: this type of linter will need exceptions, because some changes are potentially acceptable (e.g. dropping a term when it's repeated multiple times).

from fxa-content-server-l10n.

flodolo avatar flodolo commented on July 26, 2024

I'd suggest to close this, as mismatched tags are now visible as part of the checks here
https://github.com/mozilla-l10n/mozl10n-linter

P.S. I don't have rights on the repository to manage issues directly

from fxa-content-server-l10n.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.