File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,7 @@ import Handlebars from 'handlebars'
3535import identity from 'lodash/fp/identity'
3636import escapeHTML from 'escape-html'
3737import { generateFilePath } from '@nextcloud/router'
38+ import { getLanguage as _getLanguage , getLocale as _getLocale } from '@nextcloud/l10n'
3839
3940import OC from './index'
4041import {
@@ -348,16 +349,23 @@ export default L10n
348349/**
349350 * Returns the user's locale
350351 *
352+ * @deprecated use @nextcloud/l10n
351353 * @return {string } locale string
352354 */
353- export const getLocale = ( ) => $ ( 'html' ) . data ( 'locale' ) ?? 'en'
354-
355+ export const getLocale = function ( ) {
356+ console . warn ( 'Deprecated, use @nextcloud/l10n instead.' )
357+ return _getLocale ( )
358+ }
355359/**
356360 * Returns the user's language
357361 *
362+ * @deprecated use @nextcloud/l10n
358363 * @return {string } language string
359364 */
360- export const getLanguage = ( ) => $ ( 'html' ) . prop ( 'lang' )
365+ export const getLanguage = function ( ) {
366+ console . warn ( 'Deprecated, use @nextcloud/l10n instead.' )
367+ return _getLanguage ( )
368+ }
361369
362370Handlebars . registerHelper ( 't' , function ( app , text ) {
363371 return L10n . translate ( app , text )
You can’t perform that action at this time.
0 commit comments