Update src/core/I18n.js

Co-authored-by: Florian Bischof <design.falke@gmail.com>
This commit is contained in:
Yohan Boniface
2024-02-27 21:29:24 +01:00
committed by GitHub
parent 25c9473334
commit c3a5b981a9

View File

@ -24,7 +24,7 @@ export function setLocale(code) {
}
// @function translate(string: String, data?: Object): String
// Actually try to translate the `string`, with optionnal variable passed in `data`.
export function translate(string, data) {
export function translate(string, data = {}) {
if (locale && locales[locale] && locales[locale][string] !== undefined) {
string = locales[locale][string];
}