Merge pull request #402 from eauchat/patch-1

Resolve app install interface blank when app manifest argument is missing "ask" value
This commit is contained in:
Alexandre Aubin 2021-09-29 16:01:38 +02:00 committed by GitHub
commit 9a7e232da5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -8,13 +8,13 @@ import { isObjectLiteral, isEmptyValue, flattenObjectLiteral } from '@/helpers/c
* Tries to find a translation corresponding to the user's locale/fallback locale in a
* Yunohost argument or simply return the string if it's not an object literal.
*
* @param {(Object|String)} field - A field value containing a translation object or string
* @param {(Object|String|undefined)} field - A field value containing a translation object or string
* @return {String}
*/
export function formatI18nField (field) {
if (typeof field === 'string') return field
const { locale, fallbackLocale } = store.state
return field[locale] || field[fallbackLocale] || field.en
return field ? field[locale] || field[fallbackLocale] || field.en : ''
}