summaryrefslogtreecommitdiffstats
path: root/tests/lib/L10N
Commit message (Collapse)AuthorAgeFilesLines
* Add a unit test for translation with trailing colonJoas Schilling2022-04-261-0/+7
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Check style updateCarl Schwan2022-01-131-1/+1
| | | | Signed-off-by: Carl Schwan <carl@carlschwan.eu>
* Add L10n factory method for generic language heuristicsChristoph Wurst2021-10-131-123/+232
| | | | | | | | | | | 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>
* Correctly replace all PHP placeholders with the parametersJoas Schilling2021-04-201-0/+21
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Format code to a single space around binary operatorsChristoph Wurst2020-10-051-1/+1
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Change PHPDoc type hint from PHPUnit_Framework_MockObject_MockObject to ↵Morris Jobke2020-08-122-6/+6
| | | | | | \PHPUnit\Framework\MockObject\MockObject Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Use assertEqualsCanonicalizing instead of deprecated assertEquals parameterMorris Jobke2020-07-231-2/+2
| | | | Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Format control structures, classes, methods and functionChristoph Wurst2020-04-101-5/+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-1/+1
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Unify function spacing to PSR2 recommendationChristoph Wurst2020-04-091-3/+3
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Use exactly one empty line after the namespace declarationChristoph Wurst2020-04-091-1/+0
| | | | | | For PSR2 Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Use the short array syntax, everywhereChristoph Wurst2020-03-261-34/+34
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Use the shorter phpunit syntax for mocked return valuesChristoph Wurst2020-03-251-6/+6
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Mode to modern phpunitRoeland Jago Douma2019-11-272-2/+2
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Make phpunit8 compatibleRoeland Jago Douma2019-11-272-2/+2
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Move settings to an appChristoph Wurst2019-09-281-2/+2
| | | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at> Signed-off-by: npmbuildbot[bot] <npmbuildbot[bot]@users.noreply.github.com>
* Add simple unit test for findLanguageFromLocaleDaniel Kesselberg2018-09-231-0/+27
| | | | Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
* Backend work to provide NC whats New info to usersArthur Schiwon2018-07-052-0/+128
| | | | Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
* Add testsThomas Citharel2018-06-271-37/+39
| | | | Signed-off-by: Thomas Citharel <tcit@tcit.fr>
* make sure force language is reflected in html lang attributeGeorg Ehrke2018-05-221-7/+43
| | | | Signed-off-by: Georg Ehrke <developer@georgehrke.com>
* Fix "Undefined method setExpectedException()"Joas Schilling2018-01-241-1/+1
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Request->getHeader() should always return a stringMorris Jobke2018-01-171-4/+11
| | | | | | | | 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>
* use formal version of German if default_language is set to 'de_DE'Bjoern Schiessle2017-11-301-2/+42
| | | | Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
* Make L10N->l provide weekdayNameGeorg Ehrke2017-11-031-0/+5
| | | | Signed-off-by: Georg Ehrke <developer@georgehrke.com>
* Use symfony/translation for L10N pluralsRoeland Jago Douma2017-08-071-27/+0
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Don't force the use of Accept-Language anymoreJoas Schilling2017-04-071-26/+22
| | | | | | | | | | | | | | | | | 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>
* Fix more testsRoeland Jago Douma2016-10-281-139/+0
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Fix getMock L10NTestRoeland Jago Douma2016-09-071-3/+5
|
* ACCEPT_LANGUAGE goes before default_langaugeRoeland Jago Douma2016-09-041-13/+97
| | | | | | | | | | | | | | | | | | | 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
* L10N tests do not require DBRoeland Jago Douma2016-08-252-8/+16
| | | | | * Makes CI a bit more efficient * Cleanup getMock warning
* Move tests/ to PSR-4 (#24731)Joas Schilling2016-05-203-0/+759
* Move a-b to PSR-4 * Move c-d to PSR-4 * Move e+g to PSR-4 * Move h-l to PSR-4 * Move m-r to PSR-4 * Move s-u to PSR-4 * Move files/ to PSR-4 * Move remaining tests to PSR-4 * Remove Test\ from old autoloader