summaryrefslogtreecommitdiffstats
path: root/core/src/OC
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2020-06-04 10:52:03 +0200
committerChristoph Wurst <christoph@winzerhof-wurst.at>2020-06-05 08:48:49 +0200
commiteaf4724acc3b4720239d789f6028526945b8bba0 (patch)
tree145d66dcfdd5f7bef247ddc2036167610a653dc2 /core/src/OC
parenta5232d9805eb07c43d21aebcd11fea6dcde7e8b1 (diff)
downloadnextcloud-server-eaf4724acc3b4720239d789f6028526945b8bba0.tar.gz
nextcloud-server-eaf4724acc3b4720239d789f6028526945b8bba0.zip
Move humanFileSize and OC.getCanonicalLocale to npm packages
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'core/src/OC')
-rw-r--r--core/src/OC/index.js6
-rw-r--r--core/src/OC/l10n.js10
-rw-r--r--core/src/OC/util.js5
3 files changed, 8 insertions, 13 deletions
diff --git a/core/src/OC/index.js b/core/src/OC/index.js
index 59abe046769..6a5850919cc 100644
--- a/core/src/OC/index.js
+++ b/core/src/OC/index.js
@@ -79,10 +79,12 @@ import {
} from './menu'
import { isUserAdmin } from './admin'
import L10N, {
- getCanonicalLocale,
getLanguage,
getLocale,
} from './l10n'
+import {
+ getCanonicalLocale,
+} from '@nextcloud/l10n'
import {
generateUrl,
@@ -223,7 +225,7 @@ export default {
getProtocol,
/**
- * L10n
+ * @deprecated 20.0.0 use `getCanonicalLocale` from https://www.npmjs.com/package/@nextcloud/l10n
*/
getCanonicalLocale,
getLocale,
diff --git a/core/src/OC/l10n.js b/core/src/OC/l10n.js
index a4920e9d271..8eeb978b6d9 100644
--- a/core/src/OC/l10n.js
+++ b/core/src/OC/l10n.js
@@ -324,16 +324,6 @@ const L10n = {
export default L10n
/**
- * Returns the user's locale as a BCP 47 compliant language tag
- *
- * @returns {String} locale string
- */
-export const getCanonicalLocale = () => {
- const locale = getLocale()
- return typeof locale === 'string' ? locale.replace(/_/g, '-') : locale
-}
-
-/**
* Returns the user's locale
*
* @returns {String} locale string
diff --git a/core/src/OC/util.js b/core/src/OC/util.js
index 67f00bf30d3..a8666808083 100644
--- a/core/src/OC/util.js
+++ b/core/src/OC/util.js
@@ -24,7 +24,7 @@ import moment from 'moment'
import History from './util-history'
import OC from './index'
-import humanFileSize from '../Util/human-file-size'
+import { formatFileSize as humanFileSize } from '@nextcloud/files'
function chunkify(t) {
// Adapted from http://my.opera.com/GreyWyvern/blog/show.dml/1671288
@@ -58,6 +58,9 @@ export default {
History,
+ /**
+ * @deprecated use https://nextcloud.github.io/nextcloud-files/modules/_humanfilesize_.html#formatfilesize
+ */
humanFileSize,
/**