Morris Jobke
24d436cb60
Remove unneeded casts that were found by Psalm
...
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>
2021-01-11 13:14:41 +01:00
Roeland Jago Douma
441a3434f3
Move localecache to array
...
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>
2020-11-02 15:02:04 +01:00
Roeland Jago Douma
6e377a9daf
Only parse the locales ones
...
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>
2020-10-31 15:25:19 +01:00
Christoph Wurst
2a054e6c04
Update the license headers for Nextcloud 20
...
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-08-24 14:54:25 +02:00
Joas Schilling
b997edad10
Add a dedicated method to get the language for another user
...
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-07-01 10:20:07 +02:00
GretaD
fce716b905
Fix languages empty array
...
Signed-off-by: GretaD <gretadoci@gmail.com>
2020-05-08 10:03:58 +02:00
Christoph Wurst
cb057829f7
Update license headers for 19
...
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-04-29 11:57:22 +02:00
Christoph Wurst
734c62bee0
Format code according to PSR2
...
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-04-10 16:56:50 +02:00
Christoph Wurst
28f8eb5dba
Add visibility to all constants
...
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-04-10 16:54:27 +02:00
Christoph Wurst
caff1023ea
Format control structures, classes, methods and function
...
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>
2020-04-10 14:19:56 +02:00
Christoph Wurst
14c996d982
Use elseif instead of else if
...
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-04-10 10:35:09 +02:00
Christoph Wurst
44577e4345
Remove trailing and in between spaces
...
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-04-09 16:07:47 +02:00
Christoph Wurst
afbd9c4e6e
Unify function spacing to PSR2 recommendation
...
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-04-09 13:54:22 +02:00
Christoph Wurst
1a9330cd69
Update the license headers for Nextcloud 19
...
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-03-31 14:52:54 +02:00
Christoph Wurst
b80ebc9674
Use the short array syntax, everywhere
...
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-03-26 16:34:56 +01:00
Christoph Wurst
5bf3d1bb38
Update license headers
...
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2019-12-05 15:38:45 +01:00
Roeland Jago Douma
68748d4f85
Some php-cs fixes
...
* 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>
2019-11-22 20:52:10 +01:00
Christoph Wurst
de6940352a
Move settings to an app
...
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Signed-off-by: npmbuildbot[bot] <npmbuildbot[bot]@users.noreply.github.com>
2019-09-28 09:39:28 +00:00
Roeland Jago Douma
b2cc5d8fb6
Make the L10N loading lazy
...
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>
2019-05-22 11:22:12 +02:00
John Molakvoæ (skjnldsv)
7d158c62ce
Typehint
...
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
2018-09-10 11:17:03 +02:00
John Molakvoæ (skjnldsv)
df143cb72a
Use user locale as default in the template
...
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
2018-09-10 10:42:08 +02:00
Arthur Schiwon
772bbd99be
Backend work to provide NC whats New info to users
...
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2018-07-05 14:33:08 +02:00
Arthur Schiwon
25d9c3e529
adjust backend and gui to update and changelog server
...
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2018-06-29 09:11:04 +02:00
Georg Ehrke
4c1e581f47
docblock version fixes
...
Signed-off-by: Georg Ehrke <developer@georgehrke.com>
2018-06-28 17:37:16 +02:00
Georg Ehrke
8c73b13ac8
move locales file to /resources/
...
Signed-off-by: Georg Ehrke <developer@georgehrke.com>
2018-06-27 21:52:19 +02:00
Georg Ehrke
b17d256761
fix use of findLocale
...
Signed-off-by: Georg Ehrke <developer@georgehrke.com>
2018-06-27 21:52:19 +02:00
Georg Ehrke
9157086c23
properly handle force_locale setting
...
Signed-off-by: Georg Ehrke <developer@georgehrke.com>
2018-06-27 21:52:19 +02:00
Georg Ehrke
b3921c65a6
cache available locales to minimize fs access
...
Signed-off-by: Georg Ehrke <developer@georgehrke.com>
2018-06-27 21:52:19 +02:00
Thomas Citharel
bf6bfad76b
OC.getLocale() now returns Locale and no longer Language
...
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>
2018-06-27 13:19:40 +02:00
Thomas Citharel
abab7eb7f0
handle config.php values
...
Signed-off-by: Georg Ehrke <developer@georgehrke.com>
2018-06-27 13:19:23 +02:00
Thomas Citharel
4a9f8623b5
Fix review & tests
...
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2018-06-27 13:19:21 +02:00
Thomas Citharel
ea380b2918
Allow apps to specify locale for localisation
...
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2018-06-27 13:17:26 +02:00
Roeland Jago Douma
84482eb25a
Merge pull request #9435 from nextcloud/bugfix/noid/fix_force_language_html_attr
...
make sure force language is reflected in html lang attribute
2018-05-23 23:45:24 +02:00
Roeland Jago Douma
4286e17777
Always set the request language to the force language
...
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2018-05-23 21:19:46 +02:00
Georg Ehrke
2a21471c74
make sure force language is reflected in html lang attribute
...
Signed-off-by: Georg Ehrke <developer@georgehrke.com>
2018-05-22 19:30:25 +02:00
John Molakvoæ (skjnldsv)
6ada8254c9
Added language support in users list
...
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
2018-05-16 09:50:21 +02:00
Roeland Jago Douma
a423860f42
Relax what t accepts so we don't break it all
...
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2018-02-22 12:37:29 +01:00
Roeland Jago Douma
8b17f0d224
Fix other tests
...
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2018-02-21 19:53:44 +01:00
Roeland Jago Douma
2b0d640225
Proper closure for function
...
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2018-02-21 19:46:29 +01:00
Roeland Jago Douma
541056f6c2
Make OCP\IL10N strict
...
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2018-02-21 14:32:04 +01:00
Morris Jobke
c314eb74a9
Improve conditional of loop
...
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2018-01-25 22:33:43 +01:00
Morris Jobke
4ef302c0be
Request->getHeader() should always return a string
...
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>
2018-01-17 09:51:31 +01:00
Bjoern Schiessle
2c3d97cc8f
check if $defaultLanguage is a valid string before we move on
...
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
2017-12-01 16:14:51 +01:00
Bjoern Schiessle
8b734347b1
use formal version of German if default_language is set to 'de_DE'
...
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
2017-11-30 17:29:08 +01:00
Morris Jobke
31c5c2a592
Change @georgehrke's email
...
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2017-11-06 20:38:59 +01:00
Morris Jobke
0eebff152a
Update license headers
...
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2017-11-06 16:56:19 +01:00
Georg Ehrke
e111da777a
Make L10N->l provide weekdayName
...
Signed-off-by: Georg Ehrke <developer@georgehrke.com>
2017-11-03 11:20:04 +01:00
Roeland Jago Douma
ed3b391e47
Use symfony/translation for L10N plurals
...
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2017-08-07 19:53:36 +02:00
Lukas Reschke
0fa49db770
Some more invalid PHPDocs in legacy classes
...
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
2017-08-01 08:20:16 +02:00
Roeland Jago Douma
a907720817
Move \OC_L10N_String to proper \OC\L10N\L10NString
...
* Proper namespacing
* Fixed phpdocs
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2017-07-24 20:17:20 +02:00