You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently (before the custom fields to tables migrations), locales are sometimes saved as "pt-PT" and "pt_BR" due to the API returning the former and us saving the latter through I18n.locale.
e.g. we are seeing the following in the custom fields, which would mean that the table migrations (#201) also have inherited the discrepancies.
```
#<PostCustomField:0x00007faffb49f798
id: 12321231,
post_id: 1231241,
name: "translated_text",
value: "{\"en_GB\":\"\\u003cp\\u003eGreat post my friend \\u00...", # < locale is underscored
...>
# and
#<PostCustomField:0x00007faffb49dfd8
id: 12313123,
post_id: 123123,
name: "post_detected_lang",
value: "pt-PT", # < locale is hyphenated
...>
```
This commit adds a migration to convert all values to the hyphenated version, ensures we save the hyphenated ones to the db, and introduces a `locale_matches?` on the translatable models.
0 commit comments