aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/L10N/Factory.php
Commit message (Collapse)AuthorAgeFilesLines
* fix: Fix psalm taint error in L10N factoryCôme Chilliet2025-02-171-3/+24
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* feat(l10n): Respect forceLanguage query parameter in more placesfeat/add-query-param-to-force-languageCôme Chilliet2024-10-081-3/+7
| | | | | | | Attempt to make L10N Factory consistent with itself when forceLanguage query parameter is used. Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* feat(l10n): Allow to force language with a query parameterCôme Chilliet2024-10-081-1/+1
| | | | | | | | | This will be used by support application to always generate the support report in english. It may also be used to debug a language, or to temporarily show a page in an other language to take a screenshot or to share your screen with someone speaking another language. Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* fix(l10n): Fix list of RTL languagesbugfix/noid/fix-rtl-language-listJoas Schilling2024-09-271-1/+0
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* fix(rtl): Make clear that the direction is based on languagefeat/31420/bidi-backend-supportJoas Schilling2024-09-231-3/+2
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* fix(rtl): Fix list of RTL languagesJoas Schilling2024-09-231-5/+11
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* feat(rtl): Set layout direction based on languageali ghorbani2024-09-231-0/+16
| | | | Signed-off-by: ali ghorbani <ghorbani.ali.developer@gmail.com>
* chore(deps): Update nextcloud/coding-standard to v1.3.1provokateurin2024-09-191-1/+1
| | | | Signed-off-by: provokateurin <kate@provokateurin.de>
* chore: Migrate cleanAppId and getAppPath calls to IAppManager from OC_AppCôme Chilliet2024-09-131-1/+1
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* feat: reduce available languages per config value "reduce_to_languages"Misha M.-Kupriyanov2024-07-011-0/+4
| | | | | | | | | | | | Example: restrict to en, de, es, fr, it' languages ./occ config:system:set reduce_to_languages 0 --value en ./occ config:system:set reduce_to_languages 1 --value de ./occ config:system:set reduce_to_languages 2 --value es ./occ config:system:set reduce_to_languages 3 --value fr ./occ config:system:set reduce_to_languages 4 --value it Signed-off-by: Misha M.-Kupriyanov <kupriyanov@strato.de>
* chore: Add SPDX headerAndy Scherzinger2024-05-241-35/+3
| | | | Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
* fix: Fix tests following OC_App migrations to IAppManagerCôme Chilliet2024-04-221-3/+1
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* fix: Migrate a few more classes away from OC_App::getAppPathCôme Chilliet2024-04-221-33/+15
| | | | | | Also fixed AppTest Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* fix: Apply new coding standard to all filesCôme Chilliet2024-04-021-8/+8
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Update lib/private/L10N/Factory.phpc39cfbb32023-10-181-1/+1
| | | | Co-authored-by: Ferdinand Thiessen <opensource@fthiessen.de> Signed-off-by: c39cfbb3 <145777845+c39cfbb3@users.noreply.github.com>
* L10N/Factory: Support "Accept-Language: zh-Hans-CN" and alikec39cfbb32023-10-181-0/+4
| | | Signed-off-by: c39cfbb3 <145777845+c39cfbb3@users.noreply.github.com>
* Refactor "substr" calls to improve code readabilityHamid Dehnavi2023-07-071-2/+2
| | | | Signed-off-by: Hamid Dehnavi <hamid.dev.pro@gmail.com>
* Refactors "strpos" calls in lib/private to improve code readability.Faraz Samapoor2023-05-151-2/+2
| | | | Signed-off-by: Faraz Samapoor <fsamapoor@gmail.com>
* Use typed version of IConfig::getSystemValue as much as possibleCôme Chilliet2023-04-051-6/+6
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* composer run cs:fixCôme Chilliet2023-01-201-1/+0
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Cache available languages locallyJulius Härtl2022-12-071-1/+12
| | | | Signed-off-by: Julius Härtl <jus@bitgrid.net>
* Remove createPluralFunction which is replaced by Symfony\Translations libJoas Schilling2022-01-241-65/+0
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Default to language from request in L10N\Factory->getUserLanguage()Jonas Meurer2022-01-101-0/+9
| | | | | | | | | | | | | | Try to get the language from request before falling back to the instance default. This fixes the detected user language during first login of a new user and ensures that the returned language is consistent during the login. Also partially fixes a bug with Collectives folder being initialized in different languages at first login, see https://gitlab.com/collectivecloud/collectives/-/issues/238 Signed-off-by: Jonas Meurer <jonas@freesources.org>
* Add new account propertiesChristopher Ng2021-10-191-20/+24
| | | | | | | | | | | | | | - New properties - Organisation - Role - Headline - Biography - Profile Enabled property - Fix errors with building default account properties - Fix L10N factory method `getLanguage` not public error - Update tests Signed-off-by: Christopher Ng <chrng8@gmail.com>
* Add L10n factory method for generic language heuristicsChristoph Wurst2021-10-131-21/+59
| | | | | | | | | | | The existing `findLanguage` method tries its best to find the best language for the current users. For some tasks we don't want this but rather determine the most generic language for *another* user, e.g. when the current user trigger an email notifiaction to someone else. In this case the current user's language is a bad guess in many multi-language environments. Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Provide initial stateChristopher Ng2021-08-271-7/+7
| | | | | | - camelCase language strings Signed-off-by: Christopher Ng <chrng8@gmail.com>
* Update php licensesJohn Molakvoæ (skjnldsv)2021-06-041-2/+1
| | | | Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
* Bump nextcloud/coding-standard from 0.3.0 to 0.5.0dependabot-preview[bot]2021-02-181-1/+1
| | | | | | | | | | Bumps [nextcloud/coding-standard](https://github.com/nextcloud/coding-standard) from 0.3.0 to 0.5.0. - [Release notes](https://github.com/nextcloud/coding-standard/releases) - [Changelog](https://github.com/nextcloud/coding-standard/blob/master/CHANGELOG.md) - [Commits](https://github.com/nextcloud/coding-standard/compare/v0.3.0...v0.5.0) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Remove unneeded casts that were found by PsalmMorris Jobke2021-01-111-3/+3
| | | | | | In preparation of the update of Psalm from 4.2.1 to 4.3.1+ (see https://github.com/nextcloud/server/pull/24521) Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Move localecache to arrayRoeland Jago Douma2020-11-021-7/+5
| | | | | | | | It seems the DS Set in the polyfill implementation is a lot less efficient than normal arrays. (A LOT!). So for now use a stupid normal array. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Only parse the locales onesRoeland Jago Douma2020-10-311-5/+14
| | | | | | | | | | | | Before we'd go over the entire list for each translation (so each app) we'd use translation for. This means we'd also go over thise locale list (currently containing 750 entries) * apps so often this added up to ~20k calls. now we just dump the locales in a set once and then check if the entry is there. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Update the license headers for Nextcloud 20Christoph Wurst2020-08-241-0/+1
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Add a dedicated method to get the language for another userJoas Schilling2020-07-011-0/+23
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Fix languages empty arrayGretaD2020-05-081-2/+11
| | | | Signed-off-by: GretaD <gretadoci@gmail.com>
* Add visibility to all constantsChristoph Wurst2020-04-101-1/+1
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Format control structures, classes, methods and functionChristoph Wurst2020-04-101-4/+3
| | | | | | | | | | | | | | | To continue this formatting madness, here's a tiny patch that adds unified formatting for control structures like if and loops as well as classes, their methods and anonymous functions. This basically forces the constructs to start on the same line. This is not exactly what PSR2 wants, but I think we can have a few exceptions with "our" style. The starting of braces on the same line is pracrically standard for our code. This also removes and empty lines from method/function bodies at the beginning and end. Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Use elseif instead of else ifChristoph Wurst2020-04-101-2/+2
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Remove trailing and in between spacesChristoph Wurst2020-04-091-6/+6
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Unify function spacing to PSR2 recommendationChristoph Wurst2020-04-091-2/+2
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Update the license headers for Nextcloud 19Christoph Wurst2020-03-311-1/+1
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Use the short array syntax, everywhereChristoph Wurst2020-03-261-9/+9
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Update license headersChristoph Wurst2019-12-051-1/+7
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Move settings to an appChristoph Wurst2019-09-281-2/+1
| | | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at> Signed-off-by: npmbuildbot[bot] <npmbuildbot[bot]@users.noreply.github.com>
* Make the L10N loading lazyRoeland Jago Douma2019-05-221-25/+28
| | | | | | | | | Fixes #15675 This makes loading of the actual L10N lazy. So we only detect and load the actual translations when they are used. Instead of trying to load them all the time just because an app is enabled. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* TypehintJohn Molakvoæ (skjnldsv)2018-09-101-2/+1
| | | | Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
* Use user locale as default in the templateJohn Molakvoæ (skjnldsv)2018-09-101-0/+20
| | | | Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
* Backend work to provide NC whats New info to usersArthur Schiwon2018-07-051-28/+6
| | | | Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
* adjust backend and gui to update and changelog serverArthur Schiwon2018-06-291-0/+32
| | | | Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
* move locales file to /resources/Georg Ehrke2018-06-271-1/+1
| | | | Signed-off-by: Georg Ehrke <developer@georgehrke.com>
* fix use of findLocaleGeorg Ehrke2018-06-271-1/+1
| | | | Signed-off-by: Georg Ehrke <developer@georgehrke.com>