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

Add support for only publishing a language if it more than NN% translated #16

Closed
mgeisler opened this issue Apr 4, 2023 · 3 comments
Closed
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@mgeisler
Copy link
Collaborator

mgeisler commented Apr 4, 2023

When the source material keeps changing, the translations will naturally lag behind. In that case, it could be nice to only publish a new version if it mostly up-to-date, meaning it is more than NN% translated.

This kind of functionality can be built today by looking at the output of msgfmt since it shows the number of translated and untranslated messages. We should try to package the functionality in a reusable fashion.

@mgeisler mgeisler added the enhancement New feature or request label Apr 4, 2023
@mgeisler mgeisler mentioned this issue May 27, 2023
6 tasks
@mgeisler mgeisler added the help wanted Extra attention is needed label Aug 24, 2023
@mgeisler mgeisler added the good first issue Good for newcomers label Sep 11, 2023
mgeisler added a commit that referenced this issue Sep 24, 2023
The data is added to PO files automatically by `msgmerge`. This will
in turn be used when publishing a translation: it allows us to know
which sources goes into a given PO file.

Part of #16.
mgeisler added a commit that referenced this issue Sep 24, 2023
The data is added to PO files automatically by `msgmerge`. This will
in turn be used when publishing a translation: it allows us to know
which sources goes into a given PO file.

Part of #16.
mgeisler added a commit to google/comprehensive-rust that referenced this issue Sep 24, 2023
This will freeze translation in place: they will keep using the same
English Markdown source files as the starting point until a new POT
file is merged into the translation.

We still update all the files around the Markdown files: this allows
us to fix things in the theme, for example.

Part of google/mdbook-i18n-helpers#16. The
logic here should eventually be moved to somewhere in
mdbook-i18n-helpers, most likely to the renderer that @sakex is
building in google/mdbook-i18n-helpers#84.
mgeisler added a commit to google/comprehensive-rust that referenced this issue Sep 24, 2023
This will freeze translation in place: they will keep using the same
English Markdown source files as the starting point until a new POT
file is merged into the translation.

We still update all the files around the Markdown files: this allows
us to fix things in the theme, for example.

Part of google/mdbook-i18n-helpers#16. The
logic here should eventually be moved to somewhere in
mdbook-i18n-helpers, most likely to the renderer that @sakex is
building in google/mdbook-i18n-helpers#84.
mgeisler added a commit to google/comprehensive-rust that referenced this issue Sep 24, 2023
This will freeze translation in place: they will keep using the same
English Markdown source files as the starting point until a new POT
file is merged into the translation.

We still update all the files around the Markdown files: this allows
us to fix things in the theme, for example.

Part of google/mdbook-i18n-helpers#16. The
logic here should eventually be moved to somewhere in
mdbook-i18n-helpers, most likely to the renderer that @sakex is
building in google/mdbook-i18n-helpers#84.
mgeisler added a commit to google/comprehensive-rust that referenced this issue Sep 24, 2023
Before, we always used the latest English source files when
publishing. This means that translations become outdated as soon as
anything is changed in the source.

This PR changes will instead freeze translations in place: they will
keep using the same English source files until a new POT file is
merged into the translation. We do this by relying on the
POT-Creation-Date field in the PO files.

We still update all the files around the Markdown files: this allows
us to fix things in the theme, for example.

Part of google/mdbook-i18n-helpers#16. The
logic here should eventually be moved to somewhere in
mdbook-i18n-helpers, most likely to the renderer that @sakex is
building in google/mdbook-i18n-helpers#84.
mgeisler added a commit to google/comprehensive-rust that referenced this issue Sep 24, 2023
Before, we always used the latest English source files when
publishing. This means that translations become outdated as soon as
anything is changed in the source.

This PR changes will instead freeze translations in place: they will
keep using the same English source files until a new POT file is
merged into the translation. We do this by relying on the
POT-Creation-Date field in the PO files.

We still update all the files around the Markdown files: this allows
us to fix things in the theme, for example.

Part of google/mdbook-i18n-helpers#16. The
logic here should eventually be moved to somewhere in
mdbook-i18n-helpers, most likely to the renderer that @sakex is
building in google/mdbook-i18n-helpers#84.
mgeisler added a commit to google/comprehensive-rust that referenced this issue Sep 24, 2023
Before, we always used the latest English source files when
publishing. This means that translations become outdated as soon as
anything is changed in the source.

This PR changes will instead freeze translations in place: they will
keep using the same English source files until a new POT file is
merged into the translation. We do this by relying on the
POT-Creation-Date field in the PO files.

We still update all the files around the Markdown files: this allows
us to fix things in the theme, for example.

Part of google/mdbook-i18n-helpers#16. The
logic here should eventually be moved to somewhere in
mdbook-i18n-helpers, most likely to the renderer that @sakex is
building in google/mdbook-i18n-helpers#84.
mgeisler added a commit to google/comprehensive-rust that referenced this issue Sep 24, 2023
Before, we always used the latest English source files when
publishing. This means that translations become outdated as soon as
anything is changed in the source.

This PR changes will instead freeze translations in place: they will
keep using the same English source files until a new POT file is
merged into the translation. We do this by relying on the
POT-Creation-Date field in the PO files.

We still update all the files around the Markdown files: this allows
us to fix things in the theme, for example.

Part of google/mdbook-i18n-helpers#16. The
logic here should eventually be moved to somewhere in
mdbook-i18n-helpers, most likely to the renderer that @sakex is
building in google/mdbook-i18n-helpers#84.
mgeisler added a commit to google/comprehensive-rust that referenced this issue Sep 24, 2023
Before, we always used the latest English source files when
publishing. This means that translations become outdated as soon as
anything is changed in the source.

This PR changes will instead freeze translations in place: they will
keep using the same English source files until a new POT file is
merged into the translation. We do this by relying on the
POT-Creation-Date field in the PO files.

We still update all the files around the Markdown files: this allows
us to fix things in the theme, for example.

Part of google/mdbook-i18n-helpers#16. The
logic here should eventually be moved to somewhere in
mdbook-i18n-helpers, most likely to the renderer that @sakex is
building in google/mdbook-i18n-helpers#84.
mgeisler added a commit to google/comprehensive-rust that referenced this issue Sep 24, 2023
Before, we always used the latest English source files when
publishing. This means that translations become outdated as soon as
anything is changed in the source.

This PR changes will instead freeze translations in place: they will
keep using the same English source files until a new POT file is
merged into the translation. We do this by relying on the
POT-Creation-Date field in the PO files.

We still update all the files around the Markdown files: this allows
us to fix things in the theme, for example.

Part of google/mdbook-i18n-helpers#16. The
logic here should eventually be moved to somewhere in
mdbook-i18n-helpers, most likely to the renderer that @sakex is
building in google/mdbook-i18n-helpers#84.
mgeisler added a commit to google/comprehensive-rust that referenced this issue Sep 24, 2023
Before, we always used the latest English source files when
publishing. This means that translations become outdated as soon as
anything is changed in the source.

This PR changes will instead freeze translations in place: they will
keep using the same English source files until a new POT file is
merged into the translation. We do this by relying on the
POT-Creation-Date field in the PO files.

We still update all the files around the Markdown files: this allows
us to fix things in the theme, for example.

Part of google/mdbook-i18n-helpers#16. The
logic here should eventually be moved to somewhere in
mdbook-i18n-helpers, most likely to the renderer that @sakex is
building in google/mdbook-i18n-helpers#84.
mgeisler added a commit to google/comprehensive-rust that referenced this issue Sep 24, 2023
Before, we always used the latest English source files when
publishing. This means that translations become outdated as soon as
anything is changed in the source.

This PR changes will instead freeze translations in place: they will
keep using the same English source files until a new POT file is
merged into the translation. We do this by relying on the
POT-Creation-Date field in the PO files.

We still update all the files around the Markdown files: this allows
us to fix things in the theme, for example.

Part of google/mdbook-i18n-helpers#16. The
logic here should eventually be moved to somewhere in
mdbook-i18n-helpers, most likely to the renderer that @sakex is
building in google/mdbook-i18n-helpers#84.
mgeisler added a commit to google/comprehensive-rust that referenced this issue Sep 24, 2023
Before, we always used the latest English source files when
publishing. This means that translations become outdated as soon as
anything is changed in the source.

This PR changes will instead freeze translations in place: they will
keep using the same English source files until a new POT file is
merged into the translation. We do this by relying on the
POT-Creation-Date field in the PO files.

We still update all the files around the Markdown files: this allows
us to fix things in the theme, for example.

Part of google/mdbook-i18n-helpers#16. The
logic here should eventually be moved to somewhere in
mdbook-i18n-helpers, most likely to the renderer that @sakex is
building in google/mdbook-i18n-helpers#84.
mgeisler added a commit to google/comprehensive-rust that referenced this issue Sep 24, 2023
Before, we always used the latest English source files when
publishing. This means that translations become outdated as soon as
anything is changed in the source.

This PR changes will instead freeze translations in place: they will
keep using the same English source files until a new POT file is
merged into the translation. We do this by relying on the
POT-Creation-Date field in the PO files.

We still update all the files around the Markdown files: this allows
us to fix things in the theme, for example.

Part of google/mdbook-i18n-helpers#16. The
logic here should eventually be moved to somewhere in
mdbook-i18n-helpers, most likely to the renderer that @sakex is
building in google/mdbook-i18n-helpers#84.
mgeisler added a commit to google/comprehensive-rust that referenced this issue Sep 24, 2023
Before, we always used the latest English source files when
publishing. This means that translations become outdated as soon as
anything is changed in the source.

This PR changes will instead freeze translations in place: they will
keep using the same English source files until a new POT file is
merged into the translation. We do this by relying on the
POT-Creation-Date field in the PO files.

We still update all the files around the Markdown files: this allows
us to fix things in the theme, for example.

Part of google/mdbook-i18n-helpers#16. The
logic here should eventually be moved to somewhere in
mdbook-i18n-helpers, most likely to the renderer that @sakex is
building in google/mdbook-i18n-helpers#84.
mgeisler added a commit to google/comprehensive-rust that referenced this issue Sep 24, 2023
Before, we always used the latest English source files when
publishing. This means that translations become outdated as soon as
anything is changed in the source.

This PR changes will instead freeze translations in place: they will
keep using the same English source files until a new POT file is
merged into the translation. We do this by relying on the
POT-Creation-Date field in the PO files.

We still update all the files around the Markdown files: this allows
us to fix things in the theme, for example.

Part of google/mdbook-i18n-helpers#16. The
logic here should eventually be moved to somewhere in
mdbook-i18n-helpers, most likely to the renderer that @sakex is
building in google/mdbook-i18n-helpers#84.
mgeisler added a commit to google/comprehensive-rust that referenced this issue Sep 24, 2023
Before, we always used the latest English source files when
publishing. This means that translations become outdated as soon as
anything is changed in the source.

This PR changes will instead freeze translations in place: they will
keep using the same English source files until a new POT file is
merged into the translation. We do this by relying on the
POT-Creation-Date field in the PO files.

We still update all the files around the Markdown files: this allows
us to fix things in the theme, for example.

Part of google/mdbook-i18n-helpers#16. The
logic here should eventually be moved to somewhere in
mdbook-i18n-helpers, most likely to the renderer that @sakex is
building in google/mdbook-i18n-helpers#84.
mgeisler added a commit to google/comprehensive-rust that referenced this issue Sep 24, 2023
Before, we always used the latest English source files when
publishing. This means that translations become outdated as soon as
anything is changed in the source.

This PR changes will instead freeze translations in place: they will
keep using the same English source files until a new POT file is
merged into the translation. We do this by relying on the
POT-Creation-Date field in the PO files.

We still update all the files around the Markdown files: this allows
us to fix things in the theme, for example.

Part of google/mdbook-i18n-helpers#16. The
logic here should eventually be moved to somewhere in
mdbook-i18n-helpers, most likely to the renderer that @sakex is
building in google/mdbook-i18n-helpers#84.
mgeisler added a commit to google/comprehensive-rust that referenced this issue Sep 24, 2023
Before, we always used the latest English source files when
publishing. This means that translations become outdated as soon as
anything is changed in the source.

This PR changes will instead freeze translations in place: they will
keep using the same English source files until a new POT file is
merged into the translation. We do this by relying on the
POT-Creation-Date field in the PO files.

We still update all the files around the Markdown files: this allows
us to fix things in the theme, for example.

Part of google/mdbook-i18n-helpers#16. The
logic here should eventually be moved to somewhere in
mdbook-i18n-helpers, most likely to the renderer that @sakex is
building in google/mdbook-i18n-helpers#84.
mgeisler added a commit to google/comprehensive-rust that referenced this issue Sep 24, 2023
Before, we always used the latest English source files when
publishing. This means that translations become outdated as soon as
anything is changed in the source.

This PR changes will instead freeze translations in place: they will
keep using the same English source files until a new POT file is
merged into the translation. We do this by relying on the
POT-Creation-Date field in the PO files.

We still update all the files around the Markdown files: this allows
us to fix things in the theme, for example.

Part of google/mdbook-i18n-helpers#16. The
logic here should eventually be moved to somewhere in
mdbook-i18n-helpers, most likely to the renderer that @sakex is
building in google/mdbook-i18n-helpers#84.
mgeisler added a commit to google/comprehensive-rust that referenced this issue Sep 24, 2023
Before, we always used the latest English source files when
publishing. This means that translations become outdated as soon as
anything is changed in the source.

This PR changes will instead freeze translations in place: they will
keep using the same English source files until a new POT file is
merged into the translation. We do this by relying on the
POT-Creation-Date field in the PO files.

We still update all the files around the Markdown files: this allows
us to fix things in the theme, for example.

Part of google/mdbook-i18n-helpers#16. The
logic here should eventually be moved to somewhere in
mdbook-i18n-helpers, most likely to the renderer that @sakex is
building in google/mdbook-i18n-helpers#84.
mgeisler added a commit to google/comprehensive-rust that referenced this issue Sep 24, 2023
Before, we always used the latest English source files when
publishing. This means that translations become outdated as soon as
anything is changed in the source.

This PR changes will instead freeze translations in place: they will
keep using the same English source files until a new POT file is
merged into the translation. We do this by relying on the
POT-Creation-Date field in the PO files.

We still update all the files around the Markdown files: this allows
us to fix things in the theme, for example.

Part of google/mdbook-i18n-helpers#16. The
logic here should eventually be moved to somewhere in
mdbook-i18n-helpers, most likely to the renderer that @sakex is
building in google/mdbook-i18n-helpers#84.
mgeisler added a commit to google/comprehensive-rust that referenced this issue Sep 24, 2023
Before, we always used the latest English source files when
publishing. This means that translations become outdated as soon as
anything is changed in the source.

This PR changes will instead freeze translations in place: they will
keep using the same English source files until a new POT file is
merged into the translation. We do this by relying on the
POT-Creation-Date field in the PO files.

We still update all the files around the Markdown files: this allows
us to fix things in the theme, for example.

Part of google/mdbook-i18n-helpers#16. The
logic here should eventually be moved to somewhere in
mdbook-i18n-helpers, most likely to the renderer that @sakex is
building in google/mdbook-i18n-helpers#84.
mgeisler added a commit to google/comprehensive-rust that referenced this issue Sep 24, 2023
Before, we always used the latest English source files when
publishing. This means that translations become outdated as soon as
anything is changed in the source.

This PR changes will instead freeze translations in place: they will
keep using the same English source files until a new POT file is
merged into the translation. We do this by relying on the
POT-Creation-Date field in the PO files.

We still update all the files around the Markdown files: this allows
us to fix things in the theme, for example.

Part of google/mdbook-i18n-helpers#16. The
logic here should eventually be moved to somewhere in
mdbook-i18n-helpers, most likely to the renderer that @sakex is
building in google/mdbook-i18n-helpers#84.
mgeisler added a commit to google/comprehensive-rust that referenced this issue Sep 24, 2023
Before, we always used the latest English source files when
publishing. This means that translations become outdated as soon as
anything is changed in the source.

This PR changes will instead freeze translations in place: they will
keep using the same English source files until a new POT file is
merged into the translation. We do this by relying on the
POT-Creation-Date field in the PO files.

We still update all the files around the Markdown files: this allows
us to fix things in the theme, for example.

Part of google/mdbook-i18n-helpers#16. The
logic here should eventually be moved to somewhere in
mdbook-i18n-helpers, most likely to the renderer that @sakex is
building in google/mdbook-i18n-helpers#84.
mgeisler added a commit to google/comprehensive-rust that referenced this issue Sep 24, 2023
Before, we always used the latest English source files when
publishing. This means that translations become outdated as soon as
anything is changed in the source.

This PR changes will instead freeze translations in place: they will
keep using the same English source files until a new POT file is
merged into the translation. We do this by relying on the
POT-Creation-Date field in the PO files.

We still update all the files around the Markdown files: this allows
us to fix things in the theme, for example.

Part of google/mdbook-i18n-helpers#16. The
logic here should eventually be moved to somewhere in
mdbook-i18n-helpers, most likely to the renderer that @sakex is
building in google/mdbook-i18n-helpers#84.
mgeisler added a commit to google/comprehensive-rust that referenced this issue Sep 24, 2023
Before, we always used the latest English source files when
publishing. This means that translations become outdated as soon as
anything is changed in the source.

This PR changes will instead freeze translations in place: they will
keep using the same English source files until a new POT file is
merged into the translation. We do this by relying on the
POT-Creation-Date field in the PO files.

We still update all the files around the Markdown files: this allows
us to fix things in the theme, for example.

Part of google/mdbook-i18n-helpers#16. The
logic here should eventually be moved to somewhere in
mdbook-i18n-helpers, most likely to the renderer that @sakex is
building in google/mdbook-i18n-helpers#84.
mgeisler added a commit to google/comprehensive-rust that referenced this issue Sep 24, 2023
Before, we always used the latest English source files when
publishing. This means that translations become outdated as soon as
anything is changed in the source.

This PR changes will instead freeze translations in place: they will
keep using the same English source files until a new POT file is
merged into the translation. We do this by relying on the
POT-Creation-Date field in the PO files.

We still update all the files around the Markdown files: this allows
us to fix things in the theme, for example.

Part of google/mdbook-i18n-helpers#16. The
logic here should eventually be moved to somewhere in
mdbook-i18n-helpers, most likely to the renderer that @sakex is
building in google/mdbook-i18n-helpers#84.
mgeisler added a commit to google/comprehensive-rust that referenced this issue Sep 24, 2023
Before, we always used the latest English source files when
publishing. This means that translations become outdated as soon as
anything is changed in the source.

This PR changes will instead freeze translations in place: they will
keep using the same English source files until a new POT file is
merged into the translation. We do this by relying on the
POT-Creation-Date field in the PO files.

We still update all the files around the Markdown files: this allows
us to fix things in the theme, for example.

Part of google/mdbook-i18n-helpers#16. The
logic here should eventually be moved to somewhere in
mdbook-i18n-helpers, most likely to the renderer that @sakex is
building in google/mdbook-i18n-helpers#84.
mgeisler added a commit to google/comprehensive-rust that referenced this issue Sep 24, 2023
Before, we always used the latest English source files when
publishing. This means that translations become outdated as soon as
anything is changed in the source.

This PR changes will instead freeze translations in place: they will
keep using the same English source files until a new POT file is
merged into the translation. We do this by relying on the
POT-Creation-Date field in the PO files.

We still use up-to-date versions of all other files: this allows us to
fix things in the theme, for example. So the assumption here is that
never versions of our infrastructure remains compatible with old
versions of the Markdown files.

This approach has a problem: when files are moved, the English
translation will link to the new name. This name will not exist in the
old translations. We might be able to disable these links somehow.

Part of google/mdbook-i18n-helpers#16. The
logic here should eventually be moved to somewhere in
mdbook-i18n-helpers, most likely to the renderer that @sakex is
building in google/mdbook-i18n-helpers#84.
mgeisler added a commit to google/comprehensive-rust that referenced this issue Sep 25, 2023
Before, we always used the latest English source files when
publishing. This means that translations become outdated as soon as
anything is changed in the source.

This PR changes will instead freeze translations in place: they will
keep using the same English source files until a new POT file is
merged into the translation. We do this by relying on the
POT-Creation-Date field in the PO files.

We still use up-to-date versions of all other files: this allows us to
fix things in the theme, for example. So the assumption here is that
never versions of our infrastructure remains compatible with old
versions of the Markdown files.

This approach has a problem: when files are moved, the English
translation will link to the new name. This name will not exist in the
old translations. We might be able to disable these links somehow.

Part of google/mdbook-i18n-helpers#16. The
logic here should eventually be moved to somewhere in
mdbook-i18n-helpers, most likely to the renderer that @sakex is
building in google/mdbook-i18n-helpers#84.
sakex pushed a commit to sakex/mdbook-i18n-helpers that referenced this issue Sep 25, 2023
The data is added to PO files automatically by `msgmerge`. This will
in turn be used when publishing a translation: it allows us to know
which sources goes into a given PO file.

Part of google#16.
sakex added a commit to sakex/mdbook-i18n-helpers that referenced this issue Sep 25, 2023
The data is added to PO files automatically by `msgmerge`. This will
in turn be used when publishing a translation: it allows us to know
which sources goes into a given PO file.

Part of google#16.
sakex pushed a commit to sakex/mdbook-i18n-helpers that referenced this issue Sep 25, 2023
The data is added to PO files automatically by `msgmerge`. This will
in turn be used when publishing a translation: it allows us to know
which sources goes into a given PO file.

Part of google#16.
sakex pushed a commit to sakex/mdbook-i18n-helpers that referenced this issue Sep 25, 2023
The data is added to PO files automatically by `msgmerge`. This will
in turn be used when publishing a translation: it allows us to know
which sources goes into a given PO file.

Part of google#16.
@mgeisler
Copy link
Collaborator Author

This is implemented in #87, google/comprehensive-rust#1243 and google/comprehensive-rust#1252!

@mgeisler mgeisler self-assigned this Sep 25, 2023
@mgeisler
Copy link
Collaborator Author

I'm implementing a slightly different scheme: instead of a percentage, I'm implementing support for freezing the English source for a translation. This means that translators can work on a PO file for weeks and fully complete a translations — changes to the English source text won't invalidate the translation any longer.

To update a translation, run mdbook-xgettext and msgmerge like normal: this will add new strings and also update the POT-Creation-Date field in the PO file. When publishing the translation next, the English source files are taken from the time of POT-Creation-Date. This will give translations much more control over when strings are invalidated.

/cc @henrif75.

@mgeisler
Copy link
Collaborator Author

mgeisler commented Nov 2, 2023

This was fixed via #87 and google/comprehensive-rust#1243.

@mgeisler mgeisler closed this as completed Nov 2, 2023
antoniolinhart pushed a commit to antoniolinhart/mdbook-i18n-helpers that referenced this issue Jan 29, 2024
The data is added to PO files automatically by `msgmerge`. This will
in turn be used when publishing a translation: it allows us to know
which sources goes into a given PO file.

Part of google#16.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant