fabric-docs
fabric-docs copied to clipboard
Author usernames should not be translatable
Usernames of authors are currently translatable in Crowdin.
Important context on Discord
https://discord.com/channels/507304429255393322/1208846408552030238/1344312163141025843
Not really much we can do about this, as we can't disable the translation of yml frontmatter without disabling the ability to translate the page title and description.
I'm not super familiar with Crowdin's configuration, but if I understand correctly you can add custom rules to ignore some sections in files. See https://support.crowdin.com/custom-segmentation
After experimenting on https://regex101.com, I think this may work:
<rule break="yes">
<beforebreak>\A---\n(?:(?!---\n).*\n)*?authors:\n</beforebreak>
<afterbreak> *+(?!- )</afterbreak>
</rule>
/regex/ explanation
These regexes rely on lookarounds, which Crowdin should support.
beforebreak
\A: assert position at the beginning of the string (aka file)---\n: make sure we're inside of the frontmatter(?:(?!---\n).*\n)*?: match all lines beforeauthors:in the frontmatter(?:...)*?: match zero or more lines lazily, to stop when reachingauthors:below(?!---\n): a negative lookahead to make sure we're still in the frontmatter. If this matches, then the file does not mention any authors.*\n: match zero or more characters followed by a newline
authors:\n: match theauthors:line- the break starts here
afterbreak
- the break ends if this matches
*+: match zero or more spaces greedily (aka ignore indentation)- I'm pretty sure that YAML only supports spaces, but if that's not the case you can substitute this with
[ \t]*+to also match tabs
- I'm pretty sure that YAML only supports spaces, but if that's not the case you can substitute this with
(?!- ): negative lookahead for-(aka make sure there are no more authors)
This is only for manual XML/HTML based uploads, we use a different system to upload translations that doesn't support segments.
Check this out: https://github.com/FabricMC/fabric-docs/blob/07fb3816100ef588e074e60d661db1ffbc24f5cc/translated/pl_pl/develop/blocks/block-entities.md?plain=1#L5
It's unclear for Crowdin translators whether they should add their usernames to authors