Skip to content

Commit

Permalink
Merge branch 'master' into actions
Browse files Browse the repository at this point in the history
  • Loading branch information
zlzleking committed Nov 24, 2024
2 parents d5e8d88 + 4952517 commit 7da9538
Show file tree
Hide file tree
Showing 7 changed files with 76 additions and 16 deletions.
21 changes: 15 additions & 6 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,33 @@ on: [pull_request, push]
jobs:
phpcs:
name: Run phpcs
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v4

- uses: shivammathur/setup-php@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
php-version: '8.1'
tools: composer:v2

- run: composer install

- run: composer test
- name: Excute test
run: composer test

eslint:
name: Run eslint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: npm install --location=global eslint eslint-config-wikimedia eslint-plugin-json
- name: Checkout code
uses: actions/checkout@v4

- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 18.x

- run: npm install --location=global eslint@^8.0.0 eslint-config-wikimedia eslint-plugin-json
- run: eslint js --ignore-pattern 'lib/'
15 changes: 10 additions & 5 deletions LibertyTemplate.php
Original file line number Diff line number Diff line change
Expand Up @@ -924,7 +924,7 @@ protected function parseNavbar() {
foreach ( $split as $key => $value ) {
$valueArr = explode( '=', trim( $value ) );
if ( isset( $valueArr[1] ) ) {
$newValue = implode( '=', array_slice($valueArr, 1));
$newValue = implode( '=', array_slice( $valueArr, 1 ) );
$data[$valueArr[0]] = $newValue;
} else {
$data[$types[$key]] = trim( $value );
Expand All @@ -947,7 +947,9 @@ protected function parseNavbar() {
if ( isset( $data['display'] ) ) {
$textObj = $skin->msg( $data['display'] );
if ( $textObj->isDisabled() ) {
if( array_key_exists( 'link', $data ) ) $href = $data['link'];
if ( array_key_exists( 'link', $data ) ) {
$href = $data['link'];
}
} else {
$text = $textObj->text();
}
Expand All @@ -969,7 +971,9 @@ protected function parseNavbar() {
$title = $titleObj->text();
}
} else {
if( isset( $text ) ) $title = $text;
if ( isset( $text ) ) {
$title = $text;
}
}

// Link href
Expand Down Expand Up @@ -1001,7 +1005,7 @@ protected function parseNavbar() {
} else {
$classes = [];
}

// @codingStandardsIgnoreStart
$item = [
'access' => $access,
'classes' => $classes,
Expand All @@ -1012,6 +1016,7 @@ protected function parseNavbar() {
'group' => $group,
'right' => $right
];
// @codingStandardsIgnoreEnd
$level2Children = &$item['children'];
$headings[] = $item;
continue;
Expand Down Expand Up @@ -1248,7 +1253,7 @@ protected function buildAd( $position ) {
* @param Content|null $content
* @return string|null Textual form of the content, if available.
*/
private function getContentText( Content $content = null ) {
private function getContentText( ?Content $content = null ) {
if ( $content === null ) {
return '';
}
Expand Down
10 changes: 8 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
{
"name": "librewiki/liberty-mw-skin",
"version": "1.13.8",
"description": "Liberty MediaWiki Skin",
"license": "GPL-3.0+",
"require-dev": {
"mediawiki/mediawiki-codesniffer": ">=0.9.0"
},
"scripts": {
"scripts": {
"test": [
"phpcs -p -s"
],
"fix": "phpcbf"
},
"config": {
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true
}
}
}
}
2 changes: 1 addition & 1 deletion i18n/ar.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"liberty-pref-ads-header": "إزالة رأس الإعلانات.",
"liberty-pref-ads-right": "إزالة الإعلانات الصحيحة.",
"liberty-pref-ads-bottom": "إزالة الإعلانات السفلية.",
"liberty-pref-ads-belowarticle": "إزالة الإعلانات على المادة أدناه.",
"liberty-pref-ads-belowarticle": "إزالة الإعلانات الموجودة أسفل مساحة المقال",
"right-blockads-header": "يمكن إزالة رأس الإعلانات على ليبرتي الجلد.",
"right-blockads-right": "يمكن إزالة الإعلانات الصحيحة على ليبرتي الجلد.",
"right-blockads-belowarticle": "يمكن إزالة الإعلانات المادة أدناه على ليبرتي الجلد.",
Expand Down
16 changes: 15 additions & 1 deletion i18n/nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,15 @@
"authors": [
"Gam3",
"Mainframe98",
"McDutchie",
"Nickthijssen1994",
"RadioAzureus",
"Romaine",
"Siebrand"
]
},
"skinname-liberty": "Vrijheid",
"liberty-desc": "Responsieve vormgeving voor [https://librewiki.net/ LibreWiki]",
"liberty-dark-default": "Niet negeren",
"liberty-dark-dark": "Negeer en activeer de donkere modus",
"liberty-dark-light": "Negeer en activeer de heldere modus",
Expand Down Expand Up @@ -41,7 +44,10 @@
"prefs-color": "Kleurinstelling",
"prefs-layout": "Lay-out instelling",
"prefs-ads": "Advertentie instellingen",
"liberty-pref-layout-navfix": "Buiten statische navigatiebalk",
"liberty-pref-layout-sidebar": "Rechterzijbalk verwijderen",
"liberty-pref-layout-width": "Vaste breedte",
"liberty-pref-layout-width-help": "Stel de maximale grootte van het documentgebied in",
"liberty-pref-color-main": "Primaire kleur",
"liberty-pref-color-main-help": "De primaire kleur die voor deze site gebruikt zal worden.",
"liberty-pref-color-second": "Secundaire kleur",
Expand All @@ -50,6 +56,14 @@
"liberty-pref-fonts": "Selecteer het te gebruiken lettertype",
"liberty-pref-fonts-helplabel": "Hulp",
"liberty-pref-fonts-help": "Het lettertype zal vanaf de servers van Google worden geladen, met uitzondering van het Malgun Gothic lettertype.",
"liberty-pref-dark": "Systeeminstellingen voor donkere modus negeren?",
"liberty-pref-dark-help": "Kies of de systeeminstellingen gevolgd moeten worden bij het activeren van de donkere modus.",
"liberty-pref-ads-header": "Header advertenties verwijderen",
"liberty-pref-ads-right": "Rechter advertenties verwijderen"
"liberty-pref-ads-right": "Rechter advertenties verwijderen",
"liberty-pref-ads-bottom": "Advertenties onderaan verwijderen.",
"liberty-pref-ads-belowarticle": "Advertenties onder de artikelruimte verwijderen",
"right-blockads-header": "Kan kopadvertenties in de vormgeving Vrijheid verwijderen.",
"right-blockads-right": "Kan rechteradvertenties in de vormgeving Vrijheid verwijderen.",
"right-blockads-belowarticle": "Kan advertenties onder artikelen in de vormgeving Vrijheid verwijderen.",
"right-blockads-bottom": "Kan advertenties onderaan in de vormgeving Vrijheid verwijderen."
}
26 changes: 26 additions & 0 deletions i18n/pa.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"@metadata": {
"authors": [
"Cabal",
"Kuldeepburjbhalaike"
]
},
"skinname-liberty": "ਆਜ਼ਾਦੀ",
"liberty-dark-default": "ਨਜ਼ਰਅੰਦਾਜ਼ ਨਾ ਕਰੋ",
"liberty-feed-new": "[ਨਵਾਂ]",
"liberty-font-name-default": "ਮੂਲ",
"liberty-forgot-pw": "ਆਪਣਾ ਲੰਘ-ਸ਼ਬਦ ਭੁੱਲ ਗਏ ਹੋ?",
"liberty-layout-select-1200": "1200px (ਮੂਲ-ਰੂਪ)",
"liberty-login": "ਦਾਖ਼ਲ ਹੋਵੋ",
"liberty-login-alter": "ਹੋਰ ਢੰਗ ਨਾਲ ਦਾਖਲ ਹੋਵੋ",
"liberty-login-btn": "ਦਾਖ਼ਲ ਹੋਵੋ",
"liberty-info": "ਜਾਣਕਾਰੀ",
"liberty-purge": "ਸਾਫ਼ ਕਰੋ",
"liberty-recent-discussions": "ਹਾਲੀਆ ਚਰਚਾਵਾਂ",
"liberty-remember": "ਮੇਰਾ ਦਾਖ਼ਲਾ ਯਾਦ ਰੱਖੋ",
"liberty-share": "ਸਾਂਝਾ ਕਰੋ",
"liberty-tooltip-purge": "ਇਸ ਸਫ਼ੇ ਦੀ ਕੈਸ਼ ਨੂੰ ਸਾਫ਼ ਕਰੋ।",
"liberty-view-more": "ਹੋਰ ਵੇਖੋ",
"liberty-pref-color-main": "ਮੁੱਖ ਰੰਗ",
"liberty-pref-fonts-helplabel": "ਮਦਦ"
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "liberty-mw-skin",
"version": "1.6.6",
"version": "1.13.8",
"description": "ESLint for Developers.",
"main": "eslint.js",
"scripts": {
Expand Down

0 comments on commit 7da9538

Please sign in to comment.