0
0
Fork 0
mirror of https://github.com/nextcloud/server.git synced 2025-01-29 06:02:09 +00:00
Commit graph

72 commits

Author SHA1 Message Date
Côme Chilliet
5a05af05db
feat(l10n): Respect forceLanguage query parameter in more places
Attempt to make L10N Factory consistent with itself when forceLanguage
 query parameter is used.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2024-10-08 15:40:40 +02:00
Côme Chilliet
1b8949ebac
feat(l10n): Allow to force language with a query parameter
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>
2024-10-08 14:44:03 +02:00
Joas Schilling
234c44a77e
fix(l10n): Fix list of RTL languages
Signed-off-by: Joas Schilling <coding@schilljs.com>
2024-09-27 12:50:30 +02:00
Joas Schilling
82566c5479
fix(rtl): Make clear that the direction is based on language
Signed-off-by: Joas Schilling <coding@schilljs.com>
2024-09-23 17:00:07 +02:00
Joas Schilling
ae06ab5860
fix(rtl): Fix list of RTL languages
Signed-off-by: Joas Schilling <coding@schilljs.com>
2024-09-23 16:59:49 +02:00
ali ghorbani
2b7efd66b6
feat(rtl): Set layout direction based on language
Signed-off-by: ali ghorbani <ghorbani.ali.developer@gmail.com>
2024-09-23 16:59:20 +02:00
provokateurin
9836e9b164
chore(deps): Update nextcloud/coding-standard to v1.3.1
Signed-off-by: provokateurin <kate@provokateurin.de>
2024-09-19 14:21:20 +02:00
Côme Chilliet
7ed583cb8e
chore: Migrate cleanAppId and getAppPath calls to IAppManager from OC_App
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2024-09-13 10:08:43 +02:00
Misha M.-Kupriyanov
aceb4d776c feat: reduce available languages per config value "reduce_to_languages"
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>
2024-07-01 09:34:11 +02:00
Andy Scherzinger
dae7c159f7
chore: Add SPDX header
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
2024-05-24 13:11:22 +02:00
Côme Chilliet
a0be3ffdf2
fix: Fix tests following OC_App migrations to IAppManager
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2024-04-22 12:21:55 +02:00
Côme Chilliet
733a818139
fix: Migrate a few more classes away from OC_App::getAppPath
Also fixed AppTest

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2024-04-22 12:19:01 +02:00
Côme Chilliet
ec5133b739 fix: Apply new coding standard to all files
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2024-04-02 14:16:21 +02:00
c39cfbb3
1bf15da863 Update lib/private/L10N/Factory.php
Co-authored-by: Ferdinand Thiessen <opensource@fthiessen.de>
Signed-off-by: c39cfbb3 <145777845+c39cfbb3@users.noreply.github.com>
2023-10-18 02:33:54 +02:00
c39cfbb3
f7cd3d17b8 L10N/Factory: Support "Accept-Language: zh-Hans-CN" and alike
Signed-off-by: c39cfbb3 <145777845+c39cfbb3@users.noreply.github.com>
2023-10-18 02:33:54 +02:00
Hamid Dehnavi
d0b20534b9 Refactor "substr" calls to improve code readability
Signed-off-by: Hamid Dehnavi <hamid.dev.pro@gmail.com>
2023-07-07 04:54:20 +03:30
Faraz Samapoor
e7cc7653b8 Refactors "strpos" calls in lib/private to improve code readability.
Signed-off-by: Faraz Samapoor <fsamapoor@gmail.com>
2023-05-15 15:17:19 +03:30
Côme Chilliet
426c0341ff
Use typed version of IConfig::getSystemValue as much as possible
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-04-05 12:50:08 +02:00
Côme Chilliet
f5c361cf44
composer run cs:fix
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-01-20 11:45:08 +01:00
Julius Härtl
306d7829b5
Cache available languages locally
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2022-12-07 22:32:06 +01:00
Joas Schilling
f03468342e
Remove createPluralFunction which is replaced by Symfony\Translations lib
Signed-off-by: Joas Schilling <coding@schilljs.com>
2022-01-24 09:27:01 +01:00
Jonas Meurer
a6f0278e67
Default to language from request in L10N\Factory->getUserLanguage()
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>
2022-01-10 13:06:23 +01:00
Christopher Ng
7215148a24 Add new account properties
- 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>
2021-10-19 04:44:40 +00:00
Christoph Wurst
5b727fc7da
Add L10n factory method for generic language heuristics
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>
2021-10-13 09:57:21 +02:00
Christopher Ng
cc5815dcd0 Provide initial state
- camelCase language strings

Signed-off-by: Christopher Ng <chrng8@gmail.com>
2021-08-27 05:06:12 +00:00
John Molakvoæ (skjnldsv)
215aef3cbd
Update php licenses
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
2021-06-04 22:02:41 +02:00
dependabot-preview[bot]
eb502c02ff
Bump nextcloud/coding-standard from 0.3.0 to 0.5.0
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>
2021-02-18 13:31:24 +01:00
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
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
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 
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
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