@@ -27,95 +27,95 @@ |
||
| 27 | 27 | * @since 8.2.0 |
| 28 | 28 | */ |
| 29 | 29 | interface IFactory { |
| 30 | - /** |
|
| 31 | - * Get a language instance |
|
| 32 | - * |
|
| 33 | - * @param string $app |
|
| 34 | - * @param string|null $lang |
|
| 35 | - * @param string|null $locale |
|
| 36 | - * @return \OCP\IL10N |
|
| 37 | - * @since 8.2.0 |
|
| 38 | - */ |
|
| 39 | - public function get($app, $lang = null, $locale = null); |
|
| 30 | + /** |
|
| 31 | + * Get a language instance |
|
| 32 | + * |
|
| 33 | + * @param string $app |
|
| 34 | + * @param string|null $lang |
|
| 35 | + * @param string|null $locale |
|
| 36 | + * @return \OCP\IL10N |
|
| 37 | + * @since 8.2.0 |
|
| 38 | + */ |
|
| 39 | + public function get($app, $lang = null, $locale = null); |
|
| 40 | 40 | |
| 41 | - /** |
|
| 42 | - * Find the best language |
|
| 43 | - * |
|
| 44 | - * @param string|null $app App id or null for core |
|
| 45 | - * @return string language If nothing works it returns 'en' |
|
| 46 | - * @since 9.0.0 |
|
| 47 | - */ |
|
| 48 | - public function findLanguage($app = null); |
|
| 41 | + /** |
|
| 42 | + * Find the best language |
|
| 43 | + * |
|
| 44 | + * @param string|null $app App id or null for core |
|
| 45 | + * @return string language If nothing works it returns 'en' |
|
| 46 | + * @since 9.0.0 |
|
| 47 | + */ |
|
| 48 | + public function findLanguage($app = null); |
|
| 49 | 49 | |
| 50 | - /** |
|
| 51 | - * @param string|null $lang user language as default locale |
|
| 52 | - * @return string locale If nothing works it returns 'en_US' |
|
| 53 | - * @since 14.0.0 |
|
| 54 | - */ |
|
| 55 | - public function findLocale($lang = null); |
|
| 50 | + /** |
|
| 51 | + * @param string|null $lang user language as default locale |
|
| 52 | + * @return string locale If nothing works it returns 'en_US' |
|
| 53 | + * @since 14.0.0 |
|
| 54 | + */ |
|
| 55 | + public function findLocale($lang = null); |
|
| 56 | 56 | |
| 57 | - /** |
|
| 58 | - * find the matching lang from the locale |
|
| 59 | - * |
|
| 60 | - * @param string $app |
|
| 61 | - * @param string $locale |
|
| 62 | - * @return null|string |
|
| 63 | - * @since 14.0.1 |
|
| 64 | - */ |
|
| 65 | - public function findLanguageFromLocale(string $app = 'core', string $locale = null); |
|
| 57 | + /** |
|
| 58 | + * find the matching lang from the locale |
|
| 59 | + * |
|
| 60 | + * @param string $app |
|
| 61 | + * @param string $locale |
|
| 62 | + * @return null|string |
|
| 63 | + * @since 14.0.1 |
|
| 64 | + */ |
|
| 65 | + public function findLanguageFromLocale(string $app = 'core', string $locale = null); |
|
| 66 | 66 | |
| 67 | - /** |
|
| 68 | - * Find all available languages for an app |
|
| 69 | - * |
|
| 70 | - * @param string|null $app App id or null for core |
|
| 71 | - * @return string[] an array of available languages |
|
| 72 | - * @since 9.0.0 |
|
| 73 | - */ |
|
| 74 | - public function findAvailableLanguages($app = null); |
|
| 67 | + /** |
|
| 68 | + * Find all available languages for an app |
|
| 69 | + * |
|
| 70 | + * @param string|null $app App id or null for core |
|
| 71 | + * @return string[] an array of available languages |
|
| 72 | + * @since 9.0.0 |
|
| 73 | + */ |
|
| 74 | + public function findAvailableLanguages($app = null); |
|
| 75 | 75 | |
| 76 | - /** |
|
| 77 | - * @return array an array of available |
|
| 78 | - * @since 14.0.0 |
|
| 79 | - */ |
|
| 80 | - public function findAvailableLocales(); |
|
| 76 | + /** |
|
| 77 | + * @return array an array of available |
|
| 78 | + * @since 14.0.0 |
|
| 79 | + */ |
|
| 80 | + public function findAvailableLocales(); |
|
| 81 | 81 | |
| 82 | - /** |
|
| 83 | - * @param string|null $app App id or null for core |
|
| 84 | - * @param string $lang |
|
| 85 | - * @return bool |
|
| 86 | - * @since 9.0.0 |
|
| 87 | - */ |
|
| 88 | - public function languageExists($app, $lang); |
|
| 82 | + /** |
|
| 83 | + * @param string|null $app App id or null for core |
|
| 84 | + * @param string $lang |
|
| 85 | + * @return bool |
|
| 86 | + * @since 9.0.0 |
|
| 87 | + */ |
|
| 88 | + public function languageExists($app, $lang); |
|
| 89 | 89 | |
| 90 | - /** |
|
| 91 | - * @param string $locale |
|
| 92 | - * @return bool |
|
| 93 | - * @since 14.0.0 |
|
| 94 | - */ |
|
| 95 | - public function localeExists($locale); |
|
| 90 | + /** |
|
| 91 | + * @param string $locale |
|
| 92 | + * @return bool |
|
| 93 | + * @since 14.0.0 |
|
| 94 | + */ |
|
| 95 | + public function localeExists($locale); |
|
| 96 | 96 | |
| 97 | - /** |
|
| 98 | - * Creates a function from the plural string |
|
| 99 | - * |
|
| 100 | - * @param string $string |
|
| 101 | - * @return string Unique function name |
|
| 102 | - * @since 14.0.0 |
|
| 103 | - */ |
|
| 104 | - public function createPluralFunction($string); |
|
| 97 | + /** |
|
| 98 | + * Creates a function from the plural string |
|
| 99 | + * |
|
| 100 | + * @param string $string |
|
| 101 | + * @return string Unique function name |
|
| 102 | + * @since 14.0.0 |
|
| 103 | + */ |
|
| 104 | + public function createPluralFunction($string); |
|
| 105 | 105 | |
| 106 | - /** |
|
| 107 | - * iterate through language settings (if provided) in this order: |
|
| 108 | - * 1. returns the forced language or: |
|
| 109 | - * 2. if applicable, the trunk of 1 (e.g. "fu" instead of "fu_BAR" |
|
| 110 | - * 3. returns the user language or: |
|
| 111 | - * 4. if applicable, the trunk of 3 |
|
| 112 | - * 5. returns the system default language or: |
|
| 113 | - * 6. if applicable, the trunk of 5 |
|
| 114 | - * 7+∞. returns 'en' |
|
| 115 | - * |
|
| 116 | - * Hint: in most cases findLanguage() suits you fine |
|
| 117 | - * |
|
| 118 | - * @since 14.0.0 |
|
| 119 | - */ |
|
| 120 | - public function getLanguageIterator(IUser $user = null): ILanguageIterator; |
|
| 106 | + /** |
|
| 107 | + * iterate through language settings (if provided) in this order: |
|
| 108 | + * 1. returns the forced language or: |
|
| 109 | + * 2. if applicable, the trunk of 1 (e.g. "fu" instead of "fu_BAR" |
|
| 110 | + * 3. returns the user language or: |
|
| 111 | + * 4. if applicable, the trunk of 3 |
|
| 112 | + * 5. returns the system default language or: |
|
| 113 | + * 6. if applicable, the trunk of 5 |
|
| 114 | + * 7+∞. returns 'en' |
|
| 115 | + * |
|
| 116 | + * Hint: in most cases findLanguage() suits you fine |
|
| 117 | + * |
|
| 118 | + * @since 14.0.0 |
|
| 119 | + */ |
|
| 120 | + public function getLanguageIterator(IUser $user = null): ILanguageIterator; |
|
| 121 | 121 | } |