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 i18n in norent airtable. #1392

Merged
merged 1 commit into from
May 6, 2020
Merged

Conversation

toolness
Copy link
Collaborator

@toolness toolness commented May 6, 2020

This adds some plumbing for i18n to our code that pulls from the norent airtable. While it doesn't fully enable i18n in the app, it now knows to treat any field name that ends in " (English)" as being localized to en and anything ending in " (Spanish)" as being localized in es. For instance, this is what our "State Legislation for Letter Builder Screens" table looks like now:

image

At present the code in this PR is only paying attention to the English version, and it's generating the exact same JSON as it did before. This allows translators to start localizing the Airtable ASAP.

In a future commit, we'll create separate JSON files for each table in each language. Then we'll load the correct one at runtime.

@toolness toolness merged commit 5c5a249 into master May 6, 2020
@toolness toolness deleted the i18n-norent-airtable branch May 6, 2020 19:43
toolness added a commit that referenced this pull request May 7, 2020
This loads the locale-specific national metadata bundle for the NoRent site, which exposes the NoRent localized airtable data on the front-end, completing the work started in #1392.  As with the Lingui catalogs, we use code splitting to ensure that only the bundle for the current locale is retrieved.

One unfortunate aspect of this approach to localizing our national metadata is that we've got a lot of data in the locale-specific bundles that isn't actually locale-specific, and that comes with a few wrinkles, which I've documented in #1401.
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.

1 participant