Commit graph

19 commits

Author SHA1 Message Date
nokibsarkar
6895bc84d5 LanguageConverter: Added support for mni-Beng in mniwiki
This is the Language Converter from Meitei Script to Bengali Script in mniwiki.
I don't know the language. I got help from a native speaker User:Haoreima.
The original prototype was in a Python Library written by myself.
It only converts the words that have Meitei characters (U+ABC0..U+ABFF).
The original prototype is already being used in mniwiki via Gadget and a Bot.

Bug: T357853
Change-Id: I810f18050f29efa38b2a646d96644e298af47c50
2024-07-06 17:05:19 +06:00
Timo Tijhof
4160c223f2 language: Widen @covers tags in phpunit tests
Add a few missing `@group Language` tags as well.
Remove stray `@group Cache` from two classes since "Cache" is not a
MediaWiki core component (per T248519 and related tasks, we did long
ago in Bugzilla have a "MediaWiki-Cache" category, but that's since
been re-orged into BagOStuff, HTTP-Cache, and Parser/ParserCache,
and Internationalization/LocalisationCache, per the description at
<https://phabricator.wikimedia.org/project/profile/1329/>.)

Ref https://gerrit.wikimedia.org/r/q/owner:Krinkle+is:merged+message:Widen

> Given all called methods are de-facto and liberally claimed, and
> that we keep the coverage limited to the subject class, it maintains
> the spirit and intent by listing the class explicitly instead.
>
> PHPUnit offers a more precise tool when you need it (i.e. when testing
> legacy monster/god classes), but for well-written code, the
> class-wide tag is exactly what you want.
>
> We lose useful coverage and waste valuable time on keeping tags
> accurate through refactors (or worse, forget to do so).
> Tracking tiny per-method details wastes time in realizing (and
> fixing) when people inevitably don't keep them in sync, and time
> lost in finding uncovered code to write tests to realize it was
> already covered but "not yet claimed".

Bug: T364652
Change-Id: I9cfc4c210b90bfed6fd988a2525f80f5f5ee4870
2024-06-25 18:51:54 +00:00
Umherirrender
6c41df61e9 tests: Use namespaced classes (1)
Changes to the use statements done automatically via script
Addition of missing use statement done manually

Change-Id: Iae45fa269363be8ee05c598ea6926514ce817762
2024-06-14 17:19:36 +00:00
Jon Harald Søby
1df54ce20e Implement language converter for Standard Moroccan Amazigh (zgh)
Requested by the zgh community in the Wikimedia Incubator at [1];
the converter is the same as for Shilha (`shi`); the main difference
between the two languages is that the main script for `zgh` is
Tifinagh, which can't be losslessly converted to the Latin script
(the former is unicameral, the latter is bicameral), so the
converter and configuration added here is essentially one-directional.

[1] https://incubator.wikimedia.org/wiki/Special:PermaLink/6060805

Change-Id: I483a1594f001226439497f0870176e9a1e447458
2024-04-11 16:40:50 +02:00
Winston Sung
a9058148ba
Follow-up "ZhConverter: Fix language variant fallback chain"
* Removed 'zh' from all variants to prevent unexpected conversion
  (e.g., Hant in zh-cn converted to Hani with
  -{H|zh:Hani; zh-hant:Hant;}- ,
  which was referring to
  -{H|Hani=>zh-hant:Hant; Hani=>zh-tw:Hant; Hani=>zh-hk:Hant;
  Hani=>zh-mo:Hant;}-
  instead of
  -{H|zh-hans:Hani; zh-hant:Hant;}- )

Bug: T352554
Change-Id: I58db0f92e911dcce38beb2d9835681a8158328db
2024-03-08 11:37:41 +08:00
Reedy
85396a9c99 tests: Fix @covers and @coversDefaultClass to have leading \
Change-Id: I5629f91387f2ac453ee4341bfe4bba310bd52f03
2024-02-16 22:43:56 +00:00
Winston Sung
aac0c8007a ZhConverter: Fix language variant fallback chain
Fix the fallback chain for the language converter for zh by:

* Changed fallback order into
  * zh-hk' <=> 'zh-mo' first, 'zh-hant' second
  * 'zh-sg' <=> 'zh-my' first, 'zh-hans' second
* Added 'zh' to all variants (except 'zh') to reduce
  "converter-manual-rule-error" messages
  ('Error detected in manual language conversion rule').

Bug: T352554
Change-Id: Ia006c0cb00bcc809f32267b1c1feca773daadb3b
2024-02-15 04:20:40 +00:00
Bartosz Dziewoński
316915f753 LanguageConverterFactory: Use ServiceOptions
Change-Id: I8d374b51511a2873dce646aa453c5e0e2c076a14
2023-12-11 22:03:50 +01:00
James D. Forrester
e94c7fa7af Drop LanguageConverterFactory::isTitleConversionDisabled(), deprecated in 1.36
Change-Id: I8949f88866ae6bb343edc5febc34c1f5cae83831
2023-12-08 17:33:01 -05:00
Amir Sarabadani
beb3261b8d Remove language coverter for Kazakh
This has been constantly mentioned as buggy and broken and there is no
official version of latin or Arabic (see the ticket for more details).

This can be turned back as an extension if needed by third party users.

Bug: T350684
Bug: T268143
Depends-On: I6180dca2c49b3119751766268acc56087aaf8414
Change-Id: Ifbf3c8954d885daf891f8d9efc11743d898302f0
2023-11-20 10:31:16 -05:00
Fomafix
42b0f55741 Use $this->getServiceContainer() in tests
Use
	$this->getServiceContainer()
instead of
	MediaWikiServices::getInstance()
in tests where possible.

Change-Id: I798b2941f37a43b9073072935b54c3ea0cfe70dd
2023-10-17 18:40:46 +00:00
Srishakatux
bd31b57245 Remove ak from core
- Removed ak from `Names.php`, `LanguageConvertorFactoryTest.php` files
- Deleted `MessagesAk.php` file

Bug: T333765
Change-Id: Ic43b4a556158c60a9f429023b0d9b78666642680
2023-08-21 18:46:33 -07:00
Amir Sarabadani
e33818cd08 Fix space after comma in single-line array declaration
We are introducing a new phpcs sniff to make sure this doesn't happen

That sniff found this so far.

Bug: T342297
Change-Id: Ibce3f3d28e7d2cb5b0ff7230f584e76446965ddc
2023-07-24 19:04:59 +02:00
Umherirrender
66a85aeed7 tests: Use instanceof in LanguageConverterFactoryTest
Also use ::class for class names

instanceof is not exactly the same as compare with get_class,
but that is only relevant for sub-sub-types,
which are not in use on converters

Change-Id: Ib07e14bd57211920d72f7e27668bf32c604ae03c
2023-07-21 06:02:05 +00:00
Winston Sung
ab1a809acc Revert "Implement Language Converter for yue (Cantonese)"
This partially reverts Iee936baa0a42370a723b34b09a791bf0917dcdf4
 (commit 504c1a9faf).

Bug: T59106
Change-Id: I935cc23cbc2838c4338c5fb2220d8ec4cfb750a9
2023-06-13 05:35:54 +00:00
Liangent
504c1a9faf Implement Language Converter for yue (Cantonese)
This only implement unidirectional yue-Hant => yue-Hans per community consensus.

Bug: T59106
Change-Id: Iee936baa0a42370a723b34b09a791bf0917dcdf4
2023-05-20 16:11:11 +00:00
Lt2818
e69ed0fee9 Implement Language Converter for wuu (Wu)
Bug: T59138
Change-Id: I62507198ad4e467bf4c09f3545ce77188f47903e
2023-05-20 15:14:41 +00:00
Umherirrender
d36073cdcf tests: Make some PHPUnit data providers static
Initally used a new sniff with autofix (T333745),
but some provide are defined non-static in TestBase class
and need more work to make them static in a compatible way

Bug: T332865
Change-Id: I889d33424f0c01fb26f2d86f8d4fc3de3e568843
2023-05-20 01:05:27 +02:00
Umherirrender
9bcd6f7f80 tests: Move all language converter tests into /includes/
Move tests from /languages/ to /includes/language/ similiar to the
classes in f5644ba
Clean up suite config too not longer run that folder as test,
remove from coverage, there no php files to cover

Remove converter tests from Language*Test files,
all identical to the *ConverterTest cases (or remove the whole file)

Change-Id: I098ba241bd61d8ed2ee9b65393416077e3544e79
2023-02-01 20:10:56 +01:00
Renamed from tests/phpunit/languages/LanguageConverterFactoryTest.php (Browse further)