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

Update i18n tokens and locale files #5216

Merged
merged 11 commits into from Aug 18, 2023
Merged

Update i18n tokens and locale files #5216

merged 11 commits into from Aug 18, 2023

Conversation

hannahblair
Copy link
Collaborator

@hannahblair hannahblair commented Aug 14, 2023

Description

This PR:

  • Extracts a bunch of hardcoded strings into translation files
  • Refactors our translation files such that we have a common key and a key for each component. Every key should be snake case and lowercase. Example format:
{
    "common": { ... } // strings shared throughout may components
    "audio": { } // strings specific to each component
    "button": { }
    ... 
}
  • Removes a few translations that aren't used anywhere in our repo. e.g. Flag, Empty, Interpret, Examples

Closes: #1078

🎯 PRs Should Target Issues

Before your create a PR, please check to see if there is an existing issue for this change. If not, please create an issue before you create this PR, unless the fix is very small.

Not adhering to this guideline will result in the PR being closed.

Tests

  1. PRs will only be merged if tests pass on CI. To run the tests locally, please set up your Gradio environment locally and run the tests: bash scripts/run_all_tests.sh

  2. You may need to run the linters: bash scripts/format_backend.sh and bash scripts/format_frontend.sh

@gradio-pr-bot
Copy link
Contributor

gradio-pr-bot commented Aug 14, 2023

🪼 branch checks and previews

Name Status URL
Spaces ready! Spaces preview
Website ready! Website preview
Storybook building...
Visual tests building...
🦄 Changes detected! Details

Install Gradio from this PR

pip install https://gradio-builds.s3.amazonaws.com/527a24d7735338eb6ec8436af47b2140d5d3e7c5/gradio-3.40.1-py3-none-any.whl

Install Gradio Python Client from this PR

pip install "gradio-client @ git+https://github.com/gradio-app/gradio@527a24d7735338eb6ec8436af47b2140d5d3e7c5#subdirectory=client/python"

@gradio-pr-bot
Copy link
Contributor

gradio-pr-bot commented Aug 14, 2023

🦄 change detected

This Pull Request includes changes to the following packages.

Package Version
@gradio/annotatedimage minor
@gradio/app minor
@gradio/atoms minor
@gradio/audio minor
@gradio/checkbox minor
@gradio/checkboxgroup minor
@gradio/code minor
@gradio/colorpicker minor
@gradio/dataframe minor
@gradio/dropdown minor
@gradio/file minor
@gradio/gallery minor
@gradio/highlightedtext minor
@gradio/image minor
@gradio/label minor
@gradio/model3d minor
@gradio/number minor
@gradio/plot minor
@gradio/radio minor
@gradio/slider minor
@gradio/statustracker minor
@gradio/upload minor
gradio minor
  • Maintainers can select this checkbox to manually select packages to update.

With the following changelog entry.

Update i18n tokens and locale files

Maintainers or the PR author can modify the PR title to modify this entry.

Something isn't right?

  • Maintainers can change the version label to modify the version bump.
  • If the bot has failed to detect any changes, or if this pull request needs to update multiple packages to different versions or requires a more comprehensive changelog entry, maintainers can update the changelog file directly.

@hannahblair hannahblair added the no-visual-update Add this to a PR to skip chromatic deployment and tests label Aug 14, 2023
@hannahblair hannahblair marked this pull request as ready for review August 16, 2023 10:37
@aliabid94
Copy link
Collaborator

I am getting this error now in the browser console (page does not load):

Uncaught (in promise) Error: [svelte-i18n] Cannot format a message without first setting the initial locale.
    at os (runtime.esm.js:1:5583)
    at Gs (Index.svelte:99:21)
    at At (Component.js:123:5)
    at new tn (Index.svelte:237:57)
    at e.connectedCallback (main.ts:78:15)

@hannahblair
Copy link
Collaborator Author

thanks for testing @aliabid94! issue fixed

@hannahblair hannahblair merged commit 4b58ea6 into main Aug 18, 2023
18 checks passed
@hannahblair hannahblair deleted the update-i18n-tokens branch August 18, 2023 11:36
@pngwn pngwn mentioned this pull request Aug 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-visual-update Add this to a PR to skip chromatic deployment and tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

update i18n tokens
5 participants