-
Notifications
You must be signed in to change notification settings - Fork 52
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
Update fuzzy translations #69
Comments
The way Serge works is that it never alters an existing translation by itself. It should not be a concern of a low-level tool like Serge to decide whether to propagate translation changes to all unrelated string instances (event if their translations are marked as fuzzy): the same string can be translated differently depending on the context, so such bulk translation replacement is something that needs to be done in the CAT tool where the translator can see what translations will be affected, and can understand the context of each change. However, if there's no translation yet, Serge can propagate translations automatically simply as a way to save translators some initial copy-pasting work. This is where There's also a possibility to write a SQL query that would remove some "bad" translations from Serge database. Then running |
Thanks for your response. I understand that it is not the job of Serge to propagate translation changes. I believe that the |
Serge doesn't store the history of translations. If a new translation comes from a translation file (.po), this translation replaces the previous one for a specific item (instance of the string in a specific file). I.e. there can only be one translation for a given item in the database. The notion of "items" means that even if there are multiple identical strings in the file, Serge still treats them as different instances (and it will disambiguate the context to make sure context+string pair is unique within a given file). If you have multiple strings all having the same translation across the entire Serge database, and then add another identical source string, then Serge knows that there's only one possible translation for this string, and will reuse it. If you change the translation for one of these strings, this will mean that now there are multiple translations for the same source string in the database. In this case Serge will only reuse the translation if When some translated string in Serge is marked as orphaned (i.e. the string was removed from the source file, or the file with resource strings no longer exists), Serge still keeps its translation in the database, but will ignore translations for orphaned items unless |
ok, now I understand what orphaned translations are. thanks. Are fuzzy translations also reused? |
Fuzzy translations are reused as well, yes (and they are always reused as fuzzy, i.e. the fuzzy flag is never cleared on reuse). See https://github.com/evernote/serge/blob/a10b1744d9fe62c772f79832abdbf9ca8b0eb2be/lib/Serge/DB/Cached.pm#L593-L630
In your case if you translate string the very first time, the translation is auto-propagated to all same strings across all files/projects (provided you have the translation reuse feature enabled, of course). Once the translation is propagated, it is essentially locked from any automatic updates. If you then change the translation for one of your string instances to something else, this won't affect any previously propagated translations. |
Note that Serge database is pretty simple (see https://github.com/evernote/serge/blob/a10b1744d9fe62c772f79832abdbf9ca8b0eb2be/lib/Serge/sqlite_schema.sql). If you want to bulk-update translations across the entire database, the simplest use case would be to run a query like |
Thanks for your detailed responses. |
If you're using Pootle, then you can search there for all matches of an exact phrase in the translation field only (across the entire database or in a particular project or file), and just go through the found units and change the translations accordingly. There are no bulk operations there, though. |
Yes, thank you. What do you think of adding an option which is called |
This option makes sense. Will add it. |
Great. |
Closing as implemented. |
After updating a translation is it possible for fuzzy translations, that are based on that translation, to be automatically updated as well? I tried setting
reuse_orphaned
toNO
andreuse_uncertain
toYES
but that didn't help.The text was updated successfully, but these errors were encountered: