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

Prevent parallel upload of default language #24

Merged
merged 1 commit into from
Oct 1, 2024

Conversation

chrisandreae
Copy link
Member

Permitted keys of translation languages seem to depend on the default language, so upload the default language first. In addition, change to uploading translation languages in parallel.

@chrisandreae chrisandreae force-pushed the upload-default-language-first branch from bcf9078 to 01fd6da Compare September 30, 2024 06:39
@chrisandreae chrisandreae force-pushed the upload-default-language-first branch from 01fd6da to 29e0bc9 Compare September 30, 2024 07:03
Comment on lines +109 to +122
if default_locale_file
unless known_locales.has_key?(default_locale_file.locale_name)
STDERR.puts("Creating default locale (#{default_locale_file})")
create_locale(default_locale_file.locale_name, default: true)
end

STDERR.puts("Uploading default locale (#{default_locale_file})")
upload_id = upload_file(default_locale_file)

successful_default_upload = verify_uploads({ upload_id => default_locale_file })
else
STDERR.puts("No upload for default locale (#{default_locale})")
end
Copy link
Contributor

Choose a reason for hiding this comment

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

I would document this block about the motivation for separating the default locale from the other locale files.

# The default locale file is being handled separately and first. Phraseapp appears to have 
# behaviors for resolving key conflicts (pluralized versus non pluralized) by using precedence.

Permitted keys of translation languages seem to depend on the default language,
so upload the default language first. In addition, upload translation languages
in parallel.
@chrisandreae chrisandreae force-pushed the upload-default-language-first branch from 4c4b036 to 9e118df Compare October 1, 2024 03:09
@chrisandreae chrisandreae merged commit 4ecec00 into master Oct 1, 2024
4 checks passed
@chrisandreae chrisandreae deleted the upload-default-language-first branch October 1, 2024 03:09
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.

2 participants