speced / bikeshed

:bike: A preprocessor for anyone writing specifications that converts source files into actual specs.
https://speced.github.io/bikeshed
Creative Commons Zero v1.0 Universal
1.12k stars 201 forks source link

Change "Table of Contents" text based on language #2369

Open bartkl opened 2 years ago

bartkl commented 2 years ago

Hi,

I'd like to write specs in Dutch, and using the include files only gets me so far. The bikeshed/boilerplate.py has some English text hardcoded into it, such as "Table of Contents".

Is there a way I can customize this text without having to fork? I read the Boilerplate sections in the docs but couldn't find an answer.

Thanks! Bart

tabatkins commented 2 years ago

Hm, there isn't yet! That's definitely an oversight on my part, I'll go looking for all the hardcoded English in the output and make it customizeable.

(In addition to making them individually customizeable, I'll probably add an opt-in to just specify a language and have them all switch appropriately. Would you mind signing up for a Dutch localization? There shouldn't be more than a handful of phrases.)

bartkl commented 2 years ago

Nice, thanks!

And yes, I'd be willing to help with that, no problem.

tabatkins commented 2 years ago

Okay, still experimenting with this, but it looks like using gettext is the way to go.

I've done a scan over the source and I think these are all the relevant strings that aren't W3C specific, 45 in total. Mind giving them a crack? Lmk if there's more context needed for anything so I can annotate that properly.

#: bikeshed/boilerplate.py:299
msgid "Index"
msgstr ""

#: bikeshed/boilerplate.py:313
msgid "Terms defined by this specification"
msgstr ""

#: bikeshed/boilerplate.py:324
msgid "Unnumbered section"
msgstr ""

#: bikeshed/boilerplate.py:329
#, python-brace-format
msgid "{type} for {forVals}"
msgstr ""

#: bikeshed/boilerplate.py:334
msgid "definition of"
msgstr ""

#: bikeshed/boilerplate.py:356
#, python-brace-format
msgid "in {spec}"
msgstr ""

#: bikeshed/boilerplate.py:358
#, python-brace-format
msgid "for {forVals}"
msgstr ""

#: bikeshed/boilerplate.py:514 bikeshed/boilerplate.py:525
msgid ", in "
msgstr ""

#: bikeshed/boilerplate.py:588
msgid "Terms defined by reference"
msgstr ""

#: bikeshed/boilerplate.py:608
msgid "Property Index"
msgstr ""

#: bikeshed/boilerplate.py:761
msgid "IDL Index"
msgstr ""

#: bikeshed/boilerplate.py:787
msgid "Table of Contents"
msgstr ""

#: bikeshed/boilerplate.py:1097
msgid "(non-normative)"
msgstr ""

#: bikeshed/boilerplate.py:1152
msgid "References"
msgstr ""

#: bikeshed/boilerplate.py:1162
msgid "Normative References"
msgstr ""

#: bikeshed/boilerplate.py:1187
msgid "Informative References"
msgstr ""

#: bikeshed/boilerplate.py:1215
msgid "Issues Index"
msgstr ""

#: bikeshed/boilerplate.py:1228
msgid "Jump to section"
msgstr ""

#: bikeshed/dfnpanels.py:45 bikeshed/dfnpanels.py:115
msgid "Referenced in:"
msgstr ""

#: bikeshed/dfnpanels.py:104
msgid "Unnumbered Section"
msgstr ""

#: bikeshed/metadata.py:75
msgid "Editor"
msgstr ""

#: bikeshed/metadata.py:75
msgid "Editors"
msgstr ""

#: bikeshed/metadata.py:124
msgid "(This is a tracking vector.)"
msgstr ""

#: bikeshed/metadata.py:129
msgid "There is a tracking vector here."
msgstr ""

#: bikeshed/metadata.py:347
msgid "Unnamed Repo"
msgstr ""

#: bikeshed/unsortedJunk.py:996
msgid "Expands to: "
msgstr ""

#: bikeshed/unsortedJunk.py:1058
#, python-brace-format
msgid "[Issue #{number}]"
msgstr ""

#: bikeshed/unsortedJunk.py:1542
#, python-brace-format
msgid "Issue #{number} on GitHub: “{title}”"
msgstr ""

#: bikeshed/unsortedJunk.py:1563
msgid "NOTE: "
msgstr ""

#: bikeshed/unsortedJunk.py:1565
msgid "ISSUE: "
msgstr ""

#: bikeshed/unsortedJunk.py:1567
msgid "EXAMPLE: "
msgstr ""

#: bikeshed/caniuse/caniuse.py:67
msgid "Support:"
msgstr ""

#: bikeshed/caniuse/caniuse.py:82
msgid "Source: "
msgstr ""

#: bikeshed/caniuse/caniuse.py:84
#, python-brace-format
msgid " as of {date}"
msgstr ""

#: bikeshed/caniuse/caniuse.py:104
msgid " (limited)"
msgstr ""

#: bikeshed/mdn/mdnspeclinks.py:158
msgid "This feature is in less than two current engines."
msgstr ""

#: bikeshed/mdn/mdnspeclinks.py:169
msgid "This feature is in all current engines."
msgstr ""

#: bikeshed/mdn/mdnspeclinks.py:320
msgid "In no current engines."
msgstr ""

#: bikeshed/mdn/mdnspeclinks.py:322
msgid "In only one current engine."
msgstr ""

#: bikeshed/mdn/mdnspeclinks.py:324
msgid "In all current engines."
msgstr ""

#: bikeshed/mdn/mdnspeclinks.py:356
msgid "Requires setting a user preference or runtime flag."
msgstr ""

#: bikeshed/wpt/wptElement.py:83
msgid "Test Suite"
msgstr ""

#: bikeshed/wpt/wptElement.py:122
msgid "Tests"
msgstr ""

#: bikeshed/wpt/wptElement.py:175
msgid "(live test)"
msgstr ""

#: bikeshed/wpt/wptElement.py:183 bikeshed/wpt/wptElement.py:195
#: bikeshed/wpt/wptElement.py:214
msgid "(source)"
msgstr ""
bartkl commented 2 years ago

Nice! So I provide Dutch translations in the empty string positions in your quote? Here we go:

Translation remarks:

It's probably not perfect, but hey, it's a start at worst :).

Thanks for picking this up so quickly. Any idea when this might be usable for me?

#: bikeshed/boilerplate.py:299
msgid "Index"
msgstr "Index"

#: bikeshed/boilerplate.py:313
msgid "Terms defined by this specification"
msgstr "Begrippen gedefinieerd door deze specificatie"

#: bikeshed/boilerplate.py:324
msgid "Unnumbered section"
msgstr "Ongenummerde sectie"

#: bikeshed/boilerplate.py:329
#, python-brace-format
msgid "{type} for {forVals}"
msgstr "{type} voor {forVals}"

#: bikeshed/boilerplate.py:334
msgid "definition of"
msgstr "definitie van"

#: bikeshed/boilerplate.py:356
#, python-brace-format
msgid "in {spec}"
msgstr "in {spec}"

#: bikeshed/boilerplate.py:358
#, python-brace-format
msgid "for {forVals}"
msgstr "voor {forVals}"

#: bikeshed/boilerplate.py:514 bikeshed/boilerplate.py:525
msgid ", in "
msgstr ", in "

#: bikeshed/boilerplate.py:588
msgid "Terms defined by reference"
msgstr "Begrippen gedefinieerd door referentie"

#: bikeshed/boilerplate.py:608
msgid "Property Index"
msgstr "Eigenschappenindex"

#: bikeshed/boilerplate.py:761
msgid "IDL Index"
msgstr "IDL-index"

#: bikeshed/boilerplate.py:787
msgid "Table of Contents"
msgstr "Inhoudsopgave"

#: bikeshed/boilerplate.py:1097
msgid "(non-normative)"
msgstr "(niet-normatief)"

#: bikeshed/boilerplate.py:1152
msgid "References"
msgstr "Referenties"

#: bikeshed/boilerplate.py:1162
msgid "Normative References"
msgstr "Normatieve referenties"

#: bikeshed/boilerplate.py:1187
msgid "Informative References"
msgstr "Informatieve referenties"

#: bikeshed/boilerplate.py:1215
msgid "Issues Index"
msgstr "Issues-index"

#: bikeshed/boilerplate.py:1228
msgid "Jump to section"
msgstr "Ga naar sectie"

#: bikeshed/dfnpanels.py:45 bikeshed/dfnpanels.py:115
msgid "Referenced in:"
msgstr "Genoemd in:"

#: bikeshed/dfnpanels.py:104
msgid "Unnumbered Section"
msgstr "Ongenummerde sectie"

#: bikeshed/metadata.py:75
msgid "Editor"
msgstr "Redacteur"

#: bikeshed/metadata.py:75
msgid "Editors"
msgstr "Redacteurs"

#: bikeshed/metadata.py:124
msgid "(This is a tracking vector.)"
msgstr "(Dit is een tracking vector.)"

#: bikeshed/metadata.py:129
msgid "There is a tracking vector here."
msgstr "Er is een tracking vector hier."

#: bikeshed/metadata.py:347
msgid "Unnamed Repo"
msgstr "Naamloze repository"

#: bikeshed/unsortedJunk.py:996
msgid "Expands to: "
msgstr "Breidt uit naar: "

#: bikeshed/unsortedJunk.py:1058
#, python-brace-format
msgid "[Issue #{number}]"
msgstr "[Issue #{number}]"

#: bikeshed/unsortedJunk.py:1542
#, python-brace-format
msgid "Issue #{number} on GitHub: “{title}”"
msgstr "Issue #{number} op GitHub: “{title}”"

#: bikeshed/unsortedJunk.py:1563
msgid "NOTE: "
msgstr "OPMERKING: "

#: bikeshed/unsortedJunk.py:1565
msgid "ISSUE: "
msgstr "ISSUE: "

#: bikeshed/unsortedJunk.py:1567
msgid "EXAMPLE: "
msgstr "VOORBEELD: "

#: bikeshed/caniuse/caniuse.py:67
msgid "Support:"
msgstr "Ondersteuning:"

#: bikeshed/caniuse/caniuse.py:82
msgid "Source: "
msgstr "Bron: "

#: bikeshed/caniuse/caniuse.py:84
#, python-brace-format
msgid " as of {date}"
msgstr " vanaf {date}"

#: bikeshed/caniuse/caniuse.py:104
msgid " (limited)"
msgstr " (beperkt)"

#: bikeshed/mdn/mdnspeclinks.py:158
msgid "This feature is in less than two current engines."
msgstr "Deze feature is aanwezig in minder dan twee huidige engines."

#: bikeshed/mdn/mdnspeclinks.py:169
msgid "This feature is in all current engines."
msgstr "Deze feature is aanwezig in alle huidige engines."

#: bikeshed/mdn/mdnspeclinks.py:320
msgid "In no current engines."
msgstr "In geen huidige engines aanwezig."

#: bikeshed/mdn/mdnspeclinks.py:322
msgid "In only one current engine."
msgstr "In slechts één huidige engine aanwezig."

#: bikeshed/mdn/mdnspeclinks.py:324
msgid "In all current engines."
msgstr "In alle huidige engines aanwezig."

#: bikeshed/mdn/mdnspeclinks.py:356
msgid "Requires setting a user preference or runtime flag."
msgstr "Vereist het instellen van een gebruikersvoorkeur of runtime flag."

#: bikeshed/wpt/wptElement.py:83
msgid "Test Suite"
msgstr "Testsuite"

#: bikeshed/wpt/wptElement.py:122
msgid "Tests"
msgstr "Tests"

#: bikeshed/wpt/wptElement.py:175
msgid "(live test)"
msgstr "(live test)"

#: bikeshed/wpt/wptElement.py:183 bikeshed/wpt/wptElement.py:195
#: bikeshed/wpt/wptElement.py:214
msgid "(source)"
msgstr "(bron)"
sirex commented 5 months ago

What is the status of this issue?

bartkl commented 4 months ago

I would also still love this to become part of the standard customization/configuration would can do.