Locale sanity#1330
Conversation
|
If this was to be included, it'd be nice to have an easy way to push translations to crowdin from the dev environment. Is this something crowdin provides? |
|
I summon @josepjaume because I'm not really sure about Crowdin 😄 ! |
|
I think so, but unsure of how it works with branches. Maybe we could do this check prior to releasing a version? It's kinda nice being able to only include english translations and then translating them via crowdin. What we don't want is released versions with missing locales. Does this make sense to you? |
oriolgual
left a comment
There was a problem hiding this comment.
I'm sorry but I'm against this. Initially we had a similar config but we moved Catalan & Spanish two Crowdin. The reasoning behind this is that you can only have one source of truth, and that's the English locales.
I'd be OK with having a rake tasks that checks other locales, but that would be used in each installation, not in Decidim.
|
@josepjaume Makes sense to me! I can change the PR so that the full task is not run by default. Ideally it would pickup locales from an env variable so it can be run against arbitrary locales, and it should be runnable inside the main repo (to ensure completeness of official locale before releasing) and from installations (so non official locales can do something about it as well). |
|
@oriolgual So we wouldn't add nothing compulsory, just enhance the set of tools installations and core can use to enforce locale completeness. Makes sense? |
|
Is this progressing or can we close it? |
|
I was kind of expecting some more input from @oriolgual before proceeding further. |
|
Okay sorry! I had my PR grooming hat on and didn't actually read the entire conversation. |
|
Ooops, my bad, yes that makes sense @deivid-rodriguez! |
Codecov Report
@@ Coverage Diff @@
## master #1330 +/- ##
==========================================
- Coverage 95.42% 90.62% -4.81%
==========================================
Files 420 323 -97
Lines 7213 5588 -1625
==========================================
- Hits 6883 5064 -1819
- Misses 330 524 +194
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #1330 +/- ##
=======================================
Coverage 95.42% 95.42%
=======================================
Files 426 426
Lines 7342 7342
=======================================
Hits 7006 7006
Misses 336 336Continue to review full report at Codecov.
|
|
I pushed a proof of concept of what I'm proposing to do! |
|
@josepjaume Did you use this task before the last release? When I pushed the last changes, the task was detecting some missing translations, but now it's all greeny! 🎉 🎉 |
|
@deivid-rodriguez I'm not sure I've understand this: do you run the rake task from decidim root or in a decidim installation like Barcelona? I meant to do it in a installation, I don't think we should block a release because some language is missing a locale (even catalan or spanish). |
|
It can be run from both. If run from decidim's root, it checks official locales (en, ca, es). If run from an installation, it checks application locales. I added the "root check" to the release task because I think that's what @josepjaume suggested. But I can remove that bit. |
|
@deivid-rodriguez can you document how to run the task from an installation? Maybe we can add it to the getting started guide. |
|
@oriolgual I added some docs in 1a4009c! |
| task :check_locale_completeness do | ||
| DECIDIM_GEMS.each do |gem_name| | ||
| Dir.chdir("#{File.dirname(__FILE__)}/decidim-#{gem_name}") do | ||
| system({ "ENFORCED_LOCALES" => "en,ca,es" }, "rspec spec/i18n_spec.rb") |
There was a problem hiding this comment.
Shouldn't we make this configurable? Either via params to the task or using the app configured locales?
There was a problem hiding this comment.
This is the task supposed to be run from decidim's root. In that case, I wanted to hardcode it to just check the "officially supported" locales. I could make it configurable but I'm not sure if it's worth the effort...
Note that if the task is run from an app, the app locales are used instead, not via this task, but via https://github.com/decidim/decidim/pull/1330/files#diff-c3eb346890858ca91acb2f677044cdd1.
There was a problem hiding this comment.
Oh, sorry about that, I didn't realise it was two different things! About the official maintained locales: I'm not sure if we should even include Catalan & Spanish, isn't it a bit arbitrary?
There was a problem hiding this comment.
No problem! Yes, it's arbitrary. So there's two ideas here:
-
One is trying to keep locales in core that are currently 100% complete, 100% complete. This would account for the concept of "officially supported locales". Since I guess most core developers right now speak all three languages and most current installations include
caandes, choosinges,caandenas official locales seems natural. But yes, this concept of official locales is a bit arbitrary and would probably no longer make sense once/if we extractdecidim-i18nto a separate library. -
The other one is to allow installations to check their own locales. I think there's no doubts about this, we all want it, right?
There was a problem hiding this comment.
Yes, all makes sense. Let's go with it now and if we need to adjust in the future we'll do it! ![]()
With colors and all.
Currently `rake development_app` generates a development app with all locales supported by decidim. Since at the moment is compulsory to introduce all locale information in forms, it's very tedious to make manual tests using this app. So I changed it to use the same the test app uses.
As a release pre-requisite.
|
I rebased this PR on top of latest master. I'd like to get this in, specifically for 8688bfc. I usually play around with the example app, but at the moment it is generated with 7 different locales. That, in combination with #1127, makes admin forms pretty unusable. Also fixed a new |
|
We don't need Hound with CodeClimate now, we're actually talking about this! |
|
Nice! Merging this in! |
🎩 What? Why?
Just a quick proof of concept of how ensuring complete
:es,:caand:enwould look. This would partially fix translation issues for the current installations, so we can deal with the versioning stuff discussed at a later stage.Enabling the check for
:esand:calocales.This change (ad8cbda) detected some missing translations in
decidim-core. At a first glance, they look true positives to me, but I'm not sure:Enabling dynamic guessing.
This change (e454c48) led to nothing new, so I'm not sure whether it's a good change or not.
📌 Related Issues
📋 Subtasks
None
📷 Screenshots (optional)
None
👻 GIF