-
Notifications
You must be signed in to change notification settings - Fork 3
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
Validate languages from lyra.yml #106
Conversation
Every other block comment in the repository use a consistent style.
If one of this project's eventual goals is broader adoption beyond Zetkin I think it's worth broadening the regex here to Zetkin happens to be a relatively simple case where two letter language codes are getting the job done for now. Most projects I've worked on have fallen into one of these categories:
Personally I think it's only a matter of time before even Zetkin joins that third category. Probably happens once there's a good few big US- and UK- based orgs onboarded and then a feature gets added where the only vocab that works for it falls within the "not easily mutually intelligible" subset of en-GB/en-US vocabulary differences. |
Yes, I just wanted to start with as narrow validation as possible, and expand it later when we discover need. You're right though that What about "-" seems to be the preferred and canonical form: https://www.unicode.org/reports/tr35/tr35.html#BCP_47_Conformance The canonical form uses upper case for region subtags: https://www.unicode.org/reports/tr35/tr35.html#Canonical_Unicode_Locale_Identifiers |
I see three factors in play in this PR.
I think the first factor is possible to max out while minimising the second, by sacrificing the third. My understanding of your proposal is to maximise the third factor by sacrificing the second. I have a few thoughts about why I think it's the wrong sacrifice.
|
That last one has me wondering if some of this could also be addressed by augmenting how projects can be configured in Also noticed my example regex doesn't actually block the |
Yes, but I don't actually care so much about standards adherence, I just use it as a guide when choosing a minimally variable schema. My proposal was to maximise security by sacrificing users. =) I agree with you but we have to think about this a little more: I'm not sure I understand the |
Yeah quite a common thing is for a project to have its translations organised into multiple sets of files. So if there's an email feature and a podcast feature for example, there might be I think I've derailed here though. It's an interesting topic and these are important considerations but on reflection I think the right move in the short term is to unblock you here and then we can follow up on any of this other stuff if/when the time comes. Making Lyra usable for projects other than Zetkin is probably a problem best left until the Zetkin use case is completely covered and this was just a nice way for me to warm up a bit and think out loud about the problem space!! |
Maybe the distinction between repositories, projects and message identifier segments isn’t necessary. What do you think about a user just navigating all of that in a common tree? |
By allowing strange language identifiers, and providing matching strange filenames, one who controls the repository could perhaps wreck some havoc in Lyra. Validation of language codes closes one avenue of such unintended manipulation.
This relates to #34 but is arguably not part of it.