Migration guide for @uploadcare/blocks v0.38.0
BREAKING CHANGES
- CSS configuration deprecated in v0.25.0 is removed.
See the migration guide for v0.25.0 for more details. - Localizations are removed from CSS.
Now we have a special APIdefineLocale
, andlocale-name
andlocale-definition-override
options.
See below for more details.
New localization API
Previously, we had localizations in CSS, but now we have a special JS API for that:
defineLocale
method to define a locale.locale-name
option to set a defined locale.locale-definition-override
option to override a locale definition.
Detailed information about the new localization API can be found on the localization page.
Migration steps
Case 1. You were using a default English locale without any customizations
This is the simplest case. You don’t need to do anything. The default English locale is still used by default, so no changes are required.
Case 2. You were using a default English locale with customizations
You were using the default English locale with some custom translations. For example, you were using the following CSS that overrides the upload button text:
Now you need to use locale-definition-override
option to override the upload-files
key:
Get YOUR_PUBLIC_KEY
from API keys.
See the localization page for more details.
Case 3. You were using a custom non-English locale
You were using a custom non-English locale. For example, you were using the following CSS that defines a custom locale:
To achieve the same result, you need to define a custom locale using
the defineLocale
method and then set the locale-name
option:
See the localization page for more details.
Also check the our ready-to-use locales in the @uploadcare/blocks GitHub repository.
We will be happy if you contribute your custom locales to the repository.