summaryrefslogtreecommitdiffstats
path: root/lib/private/L10N
Commit message (Collapse)AuthorAgeFilesLines
* chore: Migrate away from OC::$server->getLoggerCôme Chilliet2024-02-131-1/+2
| | | | 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>
* fix(l10n): Fix plural issue with different locale and languageJoas Schilling2023-06-211-1/+6
| | | | | | | | | | We need to use the language code here instead of the locale, because Symfony does not distinguish between the two and would otherwise e.g. with locale "Czech" and language "German" try to pick a non-existing plural rule, because Czech has 4 plural forms and German only 2. Signed-off-by: Joas Schilling <coding@schilljs.com>
* Refactors "strpos" calls in lib/private to improve code readability.Faraz Samapoor2023-05-152-4/+4
| | | | Signed-off-by: Faraz Samapoor <fsamapoor@gmail.com>
* Adapt tests to config value typingCôme Chilliet2023-04-051-1/+1
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Use typed version of IConfig::getSystemValue as much as possibleCôme Chilliet2023-04-052-7/+7
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* composer run cs:fixCôme Chilliet2023-01-204-10/+7
| | | | 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>
* Use {$var} instead of ${var} for PHP 8.2 compatibilityCôme Chilliet2022-06-141-1/+1
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Fix translations with trailing colonsJoas Schilling2022-04-261-1/+7
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* 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>
* Fix Iterator return typesCôme Chilliet2021-11-231-2/+2
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Fix ArrayAccess and JsonSerializable return typesCôme Chilliet2021-11-231-5/+1
| | | | | | First round of modifications for PHP 8.1 Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* 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-046-14/+5
| | | | Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
* Fix PHP CSJoas Schilling2021-04-201-1/+1
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Correctly replace all PHP placeholders with the parametersJoas Schilling2021-04-201-5/+4
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Fix languages that miss a string in the translationJoas Schilling2021-04-201-7/+16
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Add a check for the pipe characterJoas Schilling2021-04-201-0/+6
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* "Symfony\Component\Translation\PluralizationRules" is deprecatedJoas Schilling2021-04-202-40/+23
| | | | Signed-off-by: Joas Schilling <coding@schilljs.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>
* Update license headers for 19Christoph Wurst2020-04-293-0/+3
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Format code according to PSR2Christoph Wurst2020-04-101-0/+5
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* 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-105-17/+13
| | | | | | | | | | | | | | | 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-102-4/+4
| | | | 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-092-3/+3
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Update the license headers for Nextcloud 19Christoph Wurst2020-03-312-2/+2
| | | | 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-056-7/+19
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Some php-cs fixesRoeland Jago Douma2019-11-221-0/+1
| | | | | | | | | | | * Order the imports * No leading slash on imports * Empty line before namespace * One line per import * Empty after imports * Emmpty line at bottom of file Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* 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-222-25/+98
| | | | | | | | | 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-052-28/+143
| | | | 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>
* docblock version fixesGeorg Ehrke2018-06-281-1/+1
| | | | Signed-off-by: Georg Ehrke <developer@georgehrke.com>