summaryrefslogtreecommitdiffstats
path: root/lib/private/L10N/Factory.php
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* properly handle force_locale settingGeorg Ehrke2018-06-271-0/+5
| | | | Signed-off-by: Georg Ehrke <developer@georgehrke.com>
* cache available locales to minimize fs accessGeorg Ehrke2018-06-271-6/+23
| | | | Signed-off-by: Georg Ehrke <developer@georgehrke.com>
* OC.getLocale() now returns Locale and no longer LanguageThomas Citharel2018-06-271-1/+1
| | | | | | | Added OC.getLanguage() to get Language <html lang=''> still gets language, though according to IETF BCP47 locale should be good. Signed-off-by: Thomas Citharel <tcit@tcit.fr>
* handle config.php valuesThomas Citharel2018-06-271-5/+10
| | | | Signed-off-by: Georg Ehrke <developer@georgehrke.com>
* Fix review & testsThomas Citharel2018-06-271-0/+60
| | | | Signed-off-by: Thomas Citharel <tcit@tcit.fr>
* Allow apps to specify locale for localisationThomas Citharel2018-06-271-2/+3
| | | | Signed-off-by: Thomas Citharel <tcit@tcit.fr>
* Merge pull request #9435 from nextcloud/bugfix/noid/fix_force_language_html_attrRoeland Jago Douma2018-05-231-0/+5
|\ | | | | make sure force language is reflected in html lang attribute
| * Always set the request language to the force languageRoeland Jago Douma2018-05-231-6/+5
| | | | | | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
| * make sure force language is reflected in html lang attributeGeorg Ehrke2018-05-221-0/+6
| | | | | | | | Signed-off-by: Georg Ehrke <developer@georgehrke.com>
* | Added language support in users listJohn Molakvoæ (skjnldsv)2018-05-161-3/+78
|/ | | | Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
* Improve conditional of loopMorris Jobke2018-01-251-1/+2
| | | | Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Request->getHeader() should always return a stringMorris Jobke2018-01-171-1/+1
| | | | | | | | PHPDoc (of the public API) says that this method returns string but it also returns null, which is not allowed in some method calls. This fixes that behaviour and returns an empty string and fixes all code paths that explicitly checked for null to be still compliant. Found while enabling the strict_typing for lib/private for the PHP7+ migration. Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* check if $defaultLanguage is a valid string before we move onBjoern Schiessle2017-12-011-2/+3
| | | | Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
* use formal version of German if default_language is set to 'de_DE'Bjoern Schiessle2017-11-301-1/+25
| | | | Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
* Allow to force a language and set it via the ocs apiJoas Schilling2017-06-211-1/+7
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Don't force the use of Accept-Language anymoreJoas Schilling2017-04-071-18/+0
| | | | | | | | | | | | | | | | | This is not intended anymore, since it falls back to force english when the header is not set. Also 0228bc6e66cbcb2848eacb41f1de6e7f63ebcb65 makes clear that the order should be: 1. User setting 2. Accept language 3. Admin default This is the case since the commit from above, unless via OCS and DAV. Both forced to accept-language falling back to english. By removing the force, it now also matches the w3 priority list: https://www.w3.org/International/questions/qa-lang-priorities Signed-off-by: Joas Schilling <coding@schilljs.com>
* Simplify isSubDirectory checkLukas Reschke2016-10-071-4/+26
| | | | | | Shaves off another 9ms per request as can be seen at https://blackfire.io/profiles/compare/dd54cef3-e58d-4a22-b8f4-c7c4b70697be/graph Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
* ACCEPT_LANGUAGE goes before default_langaugeRoeland Jago Douma2016-09-041-20/+37
| | | | | | | | | | | | | | | | | | | See https://github.com/nextcloud/server/issues/970 Before we had 1. Users settings in personal settings 2. Admins default language settings 3. Accept-Language settings of the browser However this is not in line with https://www.w3.org/International/questions/qa-lang-priorities So this changes the order to 1. Users settings in personal settings 3. Accept-Language settings of the browser 2. Admins default language settings
* Update with robinJoas Schilling2016-07-211-1/+1
|
* Fix othersJoas Schilling2016-07-211-2/+3
|
* Update license headersLukas Reschke2016-05-261-1/+1
|