Remove warning "No translation for appId "${appId}" have been registered" #572
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In 1.x translations registry was initialized in
OC.L10N
. The initialization includes defining global variables on script load: https://github.com/nextcloud/server/blob/352bd7ecea488201e4162e4e31a0cf9770cf20a0/core/src/OC/l10n-registry.js#L24-L26After an update
@nextcloud/[email protected]
, the lib becomes independent from the server'sOC.L10N
. But it still requiredwindow._oc_l10n_registry_translations
to be initialized and warnedNo OC L10N registry found
.In #556 it was fixed by defining
window._oc_l10n_registry_translations
on the first registration. But it also added a warning if there is no translation for an appNo translation for appId "${appId}" have been registered
.The problem is that English translations often are not supposed to be registered. Instead, the translation keys are used. It results in tons of useless warnings in the console and impacts DX.
This PR:
console.warn
mock in gettext tests to make testing silent