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

Phrase Connector, AI Translator, and Integrity Check and more #1014

Merged
merged 105 commits into from
Dec 19, 2024

Conversation

aurambaj
Copy link
Collaborator

No description provided.

aurambaj and others added 30 commits December 18, 2024 14:41
The checker will now catch the following errors:
- source: <a>hello</a> and target: </a>hello<a>
- If tags are crossing: <a><b></a></b>
Checks for Markdown links only, no other Markdown formatting is checked.
Simple, low perf implementation to copy translation between repository. Can be useful to use the ImportLocalizedAssetCommand when some strings have been moved around.
This must have changed over time, the client still had JSESSIONID but by default spring configuration now returns SESSION. The server can be configured to return the old value JSESSIONID but it does not look like the best option.

Accept both for now to be more flexible.
This is needed in case we want to pull/push/import the old locale code
This must have been broken since the spring 3.x/Hibernate migration.
Typically useful for processing JSON from FormatJS or similar. There the text unit name contain the json attribute name, which 1) is not super useful and 2) in case trying to import the translation from compiled files/KV json, it is not possible.
- Add an option to apply the integrity checks during import
- Add parallel import support
- Add option to continue on error eg. if some files are missing, try to limit the case of warnings by checking if source file is empty (which could imply there is no localized file in that case)
consider using the method from AndroidFilter
- Remove multi blank line
- Fix bug for when string had *
This is preparatory work to implement the new mode: KEEP_STATUS_IF_SAME_TARGET.

That mode will be similar to the legacy KEEP_STATUS_IF_REJECTED_AND_SAME_TARGET, but it will also retain the status when the integrity checker does not fail.

This is an extension of the legacy behavior to allow marking a translation as invalid when the integrity check didn’t catch the issue, eventually breaking a build.
The already mapped set must be empty when using the delete option. And there is no need to call the service to get what is already mapped
the new mode IntegrityChecksType.KEEP_STATUS_IF_SAME_TARGET could become default, if no test have issues.
…phrase connector

Use KEEP_STATUS_IF_SAME_TARGET in Phrase Connector as default, which different from current behavior
…ed with "false positive"

The idea is to tag properly the "false positive" so that we can easily re-apply integrity checks when bugs fixes are released.

Use a very basic "false positive" tag for now
The WS allows to review a string at a time using OpenAI chat completion API with Json format output. It grades current translation and string comment, propose alternative translations.
This is one string at a time. Review the current translation, the comment/description and suggest alternative translations
…refix

Adds the --also-close-prefixed option in the GithubCreatePRCommand. It enables the command to close open PRs that start with the provided prefix.
This service adds AI translation capabilities to a repository using the OpenAI Batch Chat Completion API. The process involves a one-pass translation similar to the prompt used for review. If some strings are rejected by the integrity check, they will be saved as rejected. The follow-up process involves re-translating these strings until a valid translation is achieved.
Not having the 'other' form in plural resources can cause the app to crash.

This commit ensures that any plural entries lacking the 'other' form are removed to prevent crashes.
Remove Phrase tags only they are older than 5 minutes, this way concurrent sync don't end up in a state where there are no tags, which break the "pull" logic.

The time window needs to be higher than the time "push" takes, putting 5 mintues for now.
Only the CLDR 'other' form must have the exact same number of placeholders. For other forms, we allow one placeholder to be removed. Note that placeholders are stored in a set, so duplicate placeholders will count as one.

This only target printflike check, so mainly targeting Android, and some gettext. This is pretty adhoc anyway
@CLAassistant
Copy link

CLAassistant commented Dec 19, 2024

CLA assistant check
All committers have signed the CLA.

@aurambaj aurambaj changed the title Ja/phrase connector Phrase Connector, AI Translator, and Integrity Check and more Dec 19, 2024
@aurambaj aurambaj merged commit 4d130fa into master Dec 19, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants