Skip to content
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

docs: change update translation sessions in nox #398

Merged
merged 11 commits into from
Sep 24, 2024

Conversation

flpm
Copy link
Member

@flpm flpm commented Aug 27, 2024

What was done

Following the discussion in PR #397, this PR makes the following changes:

  • Modify the update-translations session to only update translation files for languages in RELEASE_LANGUAGES.
  • Added a new nox session update-langugage that can be used to update the translation files for a specific language.

This PR also fixes a small syntax issue in the documentation.po file for the Spanish translation (missing quote).

How to test

Run nox -s update-translations and confirm in the output that no languages are updated

❯ nox -s update-translations
nox > Running session update-translations
nox > Re-using existing virtual environment at .nox/update-translations.
nox > No release languages defined in RELEASE_LANGUAGES
nox > Session update-translations was successful.

Run nox -s update-language -- es and verify that the .po files for the Spanish translation are updated

❯ nox -s update-language -- es
(... some lines removed ...)
The message catalogs are in _build/gettext.
nox > Updating .po files for [es] translation
nox > sphinx-intl update -p _build/gettext -l es
Update: locales/es/LC_MESSAGES/tests.po +1, -1
Update: locales/es/LC_MESSAGES/documentation.po +1, -1
Update: locales/es/LC_MESSAGES/index.po +2, -2
Update: locales/es/LC_MESSAGES/tutorials.po +41, -19
Update: locales/es/LC_MESSAGES/TRANSLATING.po +2, -2
Update: locales/es/LC_MESSAGES/CONTRIBUTING.po +68, -15
Update: locales/es/LC_MESSAGES/package-structure-code.po +18, -18
nox > Session update-language was successful.

@flpm flpm added the translations Translation and localization of content label Aug 27, 2024
@sneakers-the-rat
Copy link
Contributor

minor thing: i wonder if we can pick one term to refer to a translation or language? currently we have something like this

update
build
single
`update_language`
`build_languages`
multi
`update_translations`
`build_translations`

i don't have a strong preference between four sessions vs two sessions s.t. with no arguments they build/update all languages but with an argument only update a single language (or only the released langs, etc), but i think in either case it would be good to pick either language or translation to refer to them

@flpm
Copy link
Member Author

flpm commented Aug 27, 2024

minor thing: i wonder if we can pick one term to refer to a translation or language?

Good point, that makes sense, maybe "languages" is more semantically correct?

@flpm
Copy link
Member Author

flpm commented Aug 29, 2024

I did a bit of reorganization of the nox sessions related to translations, to harmonize the names. I also simplified it a bit, to remove the internal build to release variable.

Here is the proposed setup:

  • update-language: Update the PO files for a single language passed as a positional argument from the command line. E.g. nox -s update-language -- es. To be used by the language teams during early stages of the translation.
  • update-all-languages: Update the PO files for all languages in LANGUAGES. To be used in dev, for tests.
  • update-all-release-languages: Update the PO files for all languages in RELEASE_LANGUAGES. To be used in CI to keep PO files updated (see PR [ci] Ensure i18n up to date #397)
  • build-language: Build the guide in a single language passed as a positional argument from the command line. E.g. nox -s build-language -- es. To be used in dev.
  • build-all-languages: Build the guide for all languages in LANGUAGES. To be used in dev, for tests.
  • build-all-release-languages: Build the guide for all languages in RELEASE_LANGUAGES. Called by the docs-test nox session, which is used in CI to build the guide for release.
  • build-all-languages-test: A convenience function to run build-all-languages using the same parameters that docs-test used.

Copy link
Contributor

@sneakers-the-rat sneakers-the-rat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like it - good with me :)

as an aside, since i'm not asking you to fix nox in this PR - the only thing i wish is that nox had a bit of a better way of sharing venvs, because each of these will make their own venv which makes things big and slow. making each of the sessions independent (rather than using notify) i think makes them tidier and easier to read than notify and posargs, which i like tho, so it's an improvement imo :)

@tkoyama010
Copy link
Member

Thanks @flpm !

@tkoyama010 tkoyama010 changed the title Change update translation sessions in nox docs: change update translation sessions in nox Aug 29, 2024
@sneakers-the-rat
Copy link
Contributor

Wondering if we can merge this? i gave approval but i guess i don't have the right permissions or role or w/e to overcome the merge block.

@lwasser
Copy link
Member

lwasser commented Sep 19, 2024

oh @sneakers-the-rat i'm just getting caught up on things. you should have permissions to merge. let me check right now.

@lwasser
Copy link
Member

lwasser commented Sep 19, 2024

Jonny, I just added you to the packaging council team. Can you please try to use your superpowers to merge? You should be able to. Y'all - anytime something is being blocked because someone doesn't have enough permissions, please feel free to tag me directly !! i don't want to hold this work up.

@lwasser
Copy link
Member

lwasser commented Sep 19, 2024

anyone on this thread should now be able to merge!!

@flpm
Copy link
Member Author

flpm commented Sep 19, 2024

I just realized that this change of nox session names should be reflected in the contributor translation guide. I will make that change and then we can merge!

@sneakers-the-rat
Copy link
Contributor

@flpm how about you merge once you've made the changes you want :)

@flpm
Copy link
Member Author

flpm commented Sep 23, 2024

I added information about using the Discord server to the Translation Guide FAQ:

Screenshot from 2023-05-06 15-14-58

Copy link
Contributor

@sneakers-the-rat sneakers-the-rat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'm just gonna keep approving this lol i like what you're up to

@flpm flpm merged commit cdbdf85 into pyOpenSci:main Sep 24, 2024
4 checks passed
@flpm flpm deleted the change-update-translations branch September 24, 2024 16:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
translations Translation and localization of content
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants