sphinx-doc / sphinx-doc-translations Goto Github PK
View Code? Open in Web Editor NEWtranslated docs for sphinx official document
License: Other
translated docs for sphinx official document
License: Other
It came to my attention that sphinx-doc organization in Transifex has 3 Serbian teams: Serbian (sr), Serbian from Serbia (sr_RS) and Serbian Latin.
Regarding RTD projects there are only 2: Serbian (sr) and Serbian from Serbia (sr_RS).
In the official docs website, there is only 1: Serbian (sr). Serbian from Serbia (sr_RS)'s sphinx-sr-rs.readthedocs.io is redirected to Serbian (sr).
Only the first one (sr) has more translations and all contributors from other teams are part of the first one.
How about remove from Transifex the Serbian from Serbia (sr_RS) and Serbian Latin teams, and from Read the Docs the Serbian from Serbia (sr_SR) ?
Tasks:
/cc @AA-Turner
I've had to blacklist Tamil, and zh_CN is newly failing, meaning the translations PRs don't get updated.
https://github.com/sphinx-doc/sphinx/actions/workflows/transifex.yml
Is there a way of ensuring in transifex that these errors don't happen?
A
Last night I approved the request for Tamil language and made the requester a translator role in that team. Today it reached 100% translation for the whole Sphinx docs, and a quick look in the translation strings seems to show Sphinx syntax errors all over the strings to what seems to be machine translation applied to all strings.
For instance, see below screenshot of the view of the Tamil strings of all resources of Sphinx docs. Notice how Ubuntu package names were translated when shouldn't, :confval:`latex_enginge`
was translated when shouldn't, etc..
My question is what should be done in this case?
EDIT: note that Tamil translation is not being pulled to Sphinx docs yet, because locale/update.sh pull selected languages.
Transifex has this nice feature of setting custom placeholders that make translators job easier as it highlights the placeholders which can be copied to translation with Ctrl+Alt+NUMBER (1, 2.. n placeholders in the same screen).
According to Transifex's documentation, this can be set in:
PO File (.po, .pot) checks
Set up custom placeholders
link in the same itemNow, which placedholders should be set? First of all, there is the literal ``something``
(double backticks) which is very common, hence deserves being a placeholder
Also there are other domains that are very common, and I feel they deserve being added. Maybe not all have to added, but the most common would be interesting to be set as custom placeholder, in my opinion. See below the full list of domains used in sphinx docs, preceeded by the number of occurrences.
NOTE: using confval as an example, :confval:`
(adding a backtick after the colon) would be a good "starts with" expression, having `
as "ends with" expression in the Transifex's dialog for creating custom placeholders.
641 :confval:
338 :rst:dir:
223 :ref:
183 :file:
127 :mod:
112 :program:
112 :meth:
104 :doc:
101 :dudir:
100 :rst:role:
97 :class:
55 :term:
49 :event:
39 :command:
35 :option:
35 :func:
18 :data:
18 :attr:
16 :dfn:
14 :cpp:expr:
13 :durole:
11 :py:class:
10 :samp:
9 :exc:
8 :manpage:
6 :cpp:func:
5 :py:meth:
5 :kbd:
5 :guilabel:
5 :duref:
4 :strong:
4 :py:mod:
4 :download:
3 :py:data:
2 :py:obj:
2 :py:attr:
2 :pep:
2 :obj:
2 :math:
2 :literal:
2 :envvar:
2 :cpp:var:
2 :cpp:texpr:
2 :c:var:
2 :c:texpr:
2 :c:macro:
2 :c:expr:
1 :cpp:type:
1 :code:
For the record, I've got the above list using the (ugly, improvised) command below and cleaning a little bit some false-positive occurrences:
egrep ':([a-z]+):' $(find -name '*.pot') | sed 's| :|\n:|g;s|msgid ":|\n:|g;s|` |`\n|g;s|`"$|`\n|g;s|`,|`\n|g;s|`\\\\|`\n|g;s|`\.|`\n|g;' | grep '^:' | cut -d\` -f1 | sort | uniq -c | sort -r
EDIT: Also deserves being added as placeholder: [#_]
Hi,
Starting to work on the Internationalization page, a link to an XKCD page (always nice to found BTW ;) ), by luck at the top of it, made me realize I wasn't working on the good resource !
Quick search in Transifex editor showed me two resources: intl
and usage--advanced--intl
, and another one here in the repository that this may not be the only duplicate...
Looks like a bit of housekeeping is missing somewhere in the pipeline :)
Hi,
First and foremost, thanks for setting this up !
I have started working on French translation yesterday but just discovered that updates don't seem to be published :'(
Is this because of the conf.py issue ?
Is there any way to circumvent it ?
TY
J
main.yml
workflow actions are showing the following warning:
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Coming from:
sphinx-doc-translations/.github/workflows/main.yml
Lines 20 to 21 in 3e964f7
According to https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/, it look like it should be:
- echo "::set-output name=date::$(/bin/date -u "+%Y%m%d")"
- echo "::set-output name=yyyymm::$(/bin/date -u "+%Y%m")"
+ echo "date=$(/bin/date -u "+%Y%m%d")" >> $GITHUB_OUTPUT
+ echo "yyyymm=$(/bin/date -u "+%Y%m")" >> $GITHUB_OUTPUT
It would really nice to have custom placeholders to ease Sphinx documentation translation.
Adding custom placeholders causes the matched expression to be highlighted, be assigned unique numbers in that string, and to be warned if translation differs from the source string. I use it a lot in Python docs translation in Transifex, and I highly recommend to Sphinx docs.
Example of placeholders set in Python docs:
Setting this requires:
I might have found some commands to print the candidates for custom placeholders:
# Run this from this project root directory
# Generate 'strings.txt' with the whole-line of all translation strings
for pot in $(find locale/pot -name "*.pot"); do (msgcat --no-wrap $pot > tmp; mv tmp $pot;); done
grep -h ^msgid $(find locale/pot -name "*.pot") | sed 's|^msgid "||;s|"$||;/^$/d' > strings.txt
git checkout locale/
# Find roles with two parts like :c:macro:`something`.
grep -Po '(^|\s+):([\w\-\_\~]*:){2}`' strings.txt | sed -E 's|^ +||;' | sort -u
# Find roles with only one part like :doc:`something`
grep -Po '(^|\s+):[\w\-\_\~]*:`' strings.txt | sed -E 's|^ +||;' | sort -u
# Take not of the command-line arguments like ``-j`` (but will not use this output)
grep -Po '``-[\w\s\-\_ ]*``' strings.txt
# Also a placeholder starting with `` and ending with `` should also be added
# Find project-specific variables like "|today|" (prints nothing, but let's leave this documented):
grep -Po '|[\w\_\-]*|' strings.txt
These commands will print these:
`
)$ grep -Po '(^|\s+):([\w\-\_\~]*:){2}`' strings.txt | sed -E 's|^ +||;' | sort -u :c:macro:` :cpp:expr:` :cpp:type:` :py:class:` :py:data:` :py:func:` :py:meth:` :py:mod:` :py:obj:` :rst:dir:` :rst:role:`
`
)$ grep -Po '(^|\s+):([\w\-\_\~]*:)`' strings.txt | sed -E 's|^ +||;' | sort -u :abbr:` :attr:` :class:` :code:` :command:` :confval:` :data:` :dfn:` :doc:` :download:` :dudir:` :duref:` :durole:` :envvar:` :event:` :exc:` :file:` :func:` :guilabel:` :kbd:` :literal:` :mailheader:` :makevar:` :manpage:` :math:` :menuselection:` :meth:` :mimetype:` :mod:` :newsgroup:` :obj:` :option:` :pep:` :PEP:` :program:` :ref:` :regexp:` :rfc:` :samp:` :strong:` :term:`
``
)``-- ``- ``
I came from sphinx doc, autosummary section.
Some translation results confused me. Like following one.
Chinese result:
:文件:`autosummary/基准.rst`
English source:
:file:`autosummary/base.rst`
I thought :file:
is a mark and base.rst
is a specific file name, it shouldn't translate.
If they were translated, they couldn't be understood well.
So just keep the origin is fine, like this.
":file:`autosummary/base.rst` -- 回退模板"
And I found there have the same problems in other places.
A few weeks ago, I started to work on contributing zh_TW translation in Transifex.
And it seems that there is no string reviewed currently.
When will zh_TW be added in http://www.sphinx-doc.org/?
.readthedocs.yml sets -D language=$READTHEDOCS_LANGUAGE
and the environment variable $READTHEDOCS_LANGUAGE in Read The Docs gives pt-br
and zh-cn
(all lowercase, dash instead of underscore). This causes the docs build to not find the translation files (since there is a pt_BR/ directory, not a pt-br/).
Newly-added docs-related resources were created using POT filename as the resource name. That's a bug in sphinx-intl. Transifex organization admin, please fix the resource name to be equal to the resource slug, just like the rest of this project's resources.
Resource name | Resource slug |
---|---|
c.pot | usage--domains--c |
cpp.pot | usage--domains--cpp |
index.pot | usage--domains--index |
javascript.pot | usage--domains--javascript |
mathematics.pot | usage--domains--mathematics |
python.pot | usage--domains--python |
standard.pot | usage--domains--standard |
restructuredtext.pot | usage--domains--restructuredtext |
I see the .travis-ci.yml pointing to travis-ci.org, which is no longer working. From sphinx-doc-translations project on travis-ci.org:
Since June 15th, 2021, the building on travis-ci.org is ceased. Please use travis-ci.com from now on.
On travis-ci.com, the sphinx-doc-translations project has empty build history as well.
I see a pending PR on migrating travis to GitHub Actions, but how about fixing it while the PR doesn't land?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.