jenkins-bot has submitted this change and it was merged.

Change subject: Add support for EntryScape
......................................................................


Add support for EntryScape

This deviates a bit from existing practices, taking first steps
to a streamlined process:
* Drop "out-" prefix from group ids
* Drop "-0-all" suffix from aggre group
* Skip repocreate, repoupdate now clones if missing
* Make message keys full case sensitive in page names

Bug: T95284
Change-Id: I31921d83c4cafcb4854119908ed48557a0645a64
---
M REPOCONF
M TranslateSettings.php
M bin/repocommit
M bin/repoexport
M bin/repoupdate
A groups/EntryScape/Checker.php
A groups/EntryScape/EntryScape.yaml
A groups/EntryScape/Suggester.php
8 files changed, 268 insertions(+), 3 deletions(-)

Approvals:
  Nikerabbit: Looks good to me, approved
  Nemo bis: Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/REPOCONF b/REPOCONF
index 9d3917b..cb3a43a 100644
--- a/REPOCONF
+++ b/REPOCONF
@@ -8,6 +8,7 @@
 
 REPO_BLOCKLY=git://github.com/google/blockly.git
 REPO_BLOCKLYGAMES=git://github.com/google/blockly-games.git
+REPO_ENTRYSCAPE=https://bitbucket.org/metasolutions/entryscape.git
 REPO_EOL=git://github.com/EOL/eol.git
 REPO_ETHERPADLITE=git://github.com/ether/etherpad-lite.git
 REPO_ETHERPADLITE_BRANCH="develop"
diff --git a/TranslateSettings.php b/TranslateSettings.php
index 5155f69..9c10a20 100644
--- a/TranslateSettings.php
+++ b/TranslateSettings.php
@@ -328,3 +328,8 @@
 
 wfAddNamespace( 1262, 'iNaturalist' );
 $wgTranslateGroupFiles[] = "$GROUPS/iNaturalist/iNaturalist.yaml";
+
+wfAddNamespace( 1264, 'EntryScape' );
+$wgCapitalLinkOverrides[NS_ENTRYSCAPE] = false;
+$wgCapitalLinkOverrides[NS_ENTRYSCAPE_TALK] = false;
+$wgTranslateGroupFiles[] = "$GROUPS/EntryScape/EntryScape.yaml";
diff --git a/bin/repocommit b/bin/repocommit
index 4ddec10..bb4982e 100755
--- a/bin/repocommit
+++ b/bin/repocommit
@@ -38,6 +38,7 @@
 # TODO: Move to separate file?
 GITPROJECTS="\
 blockly \
+entryscape \
 eol \
 europeana \
 freecol \
diff --git a/bin/repoexport b/bin/repoexport
index 6691d09..5f2c5ec 100755
--- a/bin/repoexport
+++ b/bin/repoexport
@@ -24,6 +24,10 @@
 then
        php "$EXPORTER" --target . --group=out-blockly* --lang='*' --skip en 
$THRESHOLD
 
+elif [ "$PROJECT" = "entryscape" ]
+then
+       php "$EXPORTER" --target . --group=entryscape-* --lang='*' --skip en 
$THRESHOLD
+
 elif [ "$PROJECT" = "eol" ]
 then
        php "$EXPORTER" --target . --group=out-eol* --lang='*' --skip en 
$THRESHOLD
diff --git a/bin/repoupdate b/bin/repoupdate
index 2d59e05..0948e95 100755
--- a/bin/repoupdate
+++ b/bin/repoupdate
@@ -1,5 +1,6 @@
 #!/bin/bash
 set -e
+set -u
 
 DIRSCRIPT="`dirname \"$0\"`"
 DIRSCRIPT="`( cd \"$DIRSCRIPT\" && pwd )`"
@@ -7,15 +8,20 @@
 PROJECT=$1
 WIKI=/srv/mediawiki/targets/production
 
-DIR=$2
-: ${DIR:=`pwd`}
+DIR="${2:-`pwd`}"
 source $DIRSCRIPT/findexportroot
 cd "$DIR"
 
 echo "$(date --rfc-3339=seconds --utc) [$(whoami) at $DIR] $0 $@" >> $DIRLOG
 
+checkVar() {
+       if [ -z "${!1:-}" ]
+               then echo "Add ${1} to REPOCONF"; exit 1
+       fi
+}
+
 gitupdate() {
-       "$DIRSCRIPT/update-reset-repo" "$DIR" "$1" "$2"
+       "$DIRSCRIPT/update-reset-repo" "$DIR" "$1" "${2:-master}"
 }
 
 processGroups() {
@@ -34,6 +40,7 @@
        sort
 }
 
+CLUPDATE="$DIRSCRIPT/clupdate-git-repo";
 if [ "${REPO_RW:-no}" = "yes" ]
 then CLUPDATE_GERRIT="$DIRSCRIPT/clupdate-gerrit-repo";
 else CLUPDATE_GERRIT="$DIRSCRIPT/clupdate-git-repo";
@@ -73,6 +80,12 @@
        gitupdate "$PROJECT"
        gitupdate "blockly-games"
 
+elif [ "$PROJECT" = "entryscape" ]
+then
+       VAR="REPO_${PROJECT^^}"
+       checkVar "$VAR"
+       "$CLUPDATE" "${!VAR}" "$DIR/$PROJECT"
+
 elif [ "$PROJECT" = "etherpad-lite" ]
 then
        gitupdate "$PROJECT" $REPO_ETHERPADLITE_BRANCH
diff --git a/groups/EntryScape/Checker.php b/groups/EntryScape/Checker.php
new file mode 100644
index 0000000..f48d5f4
--- /dev/null
+++ b/groups/EntryScape/Checker.php
@@ -0,0 +1,12 @@
+<?php
+/**
+ * @file
+ * @author Niklas Laxström
+ * @license GPL-2.0+
+ */
+
+class EntryScapeMessageChecker extends MessageChecker {
+       protected function EntryScapeVariablesCheck( $messages, $code, 
&$warnings ) {
+               return parent::parameterCheck( $messages, $code, $warnings, 
'/\$?{[^}]+}|%s/' );
+       }
+}
diff --git a/groups/EntryScape/EntryScape.yaml 
b/groups/EntryScape/EntryScape.yaml
new file mode 100644
index 0000000..1f9c0de
--- /dev/null
+++ b/groups/EntryScape/EntryScape.yaml
@@ -0,0 +1,199 @@
+---
+TEMPLATE:
+  BASIC:
+    icon: wiki://EntryScape_logo.png
+    description: "{{Special:MyLanguage/Translations:Group 
descriptions/entryscape/en}}"
+    namespace: NS_ENTRYSCAPE
+
+  CHECKER:
+    class: EntryScapeMessageChecker
+    checks:
+      - EntryScapeVariablesCheck
+
+  INSERTABLES:
+    class: EntryScapeInsertablesSuggester
+
+  AUTOLOAD:
+    EntryScapeMessageChecker: Checker.php
+    EntryScapeInsertablesSuggester: Suggester.php
+
+---
+BASIC:
+  id: entryscape
+  label: Entryscape
+  class: AggregateMessageGroup
+  meta: yes
+
+GROUPS:
+  - "entryscape-*"
+
+---
+BASIC:
+  id: entryscape-create
+  label: Entryscape (create)
+  class: FileBasedMessageGroup
+
+FILES:
+  class: AmdFFS
+  definitionFile: "%GROUPROOT%/entryscape/create.js"
+  sourcePattern: "%GROUPROOT%/entryscape/%CODE%/create.js"
+
+MANGLER:
+  class: StringMatcher
+  patterns:
+    - "*"
+  prefix: create-
+
+---
+BASIC:
+  id: entryscape-details
+  label: Entryscape (details)
+  class: FileBasedMessageGroup
+
+FILES:
+  class: AmdFFS
+  definitionFile: "%GROUPROOT%/entryscape/details.js"
+  sourcePattern: "%GROUPROOT%/entryscape/%CODE%/details.js"
+
+MANGLER:
+  class: StringMatcher
+  patterns:
+    - "*"
+  prefix: details-
+
+---
+BASIC:
+  id: entryscape-editor
+  label: Entryscape (editor)
+  class: FileBasedMessageGroup
+
+FILES:
+  class: AmdFFS
+  definitionFile: "%GROUPROOT%/entryscape/editor.js"
+  sourcePattern: "%GROUPROOT%/entryscape/%CODE%/editor.js"
+
+MANGLER:
+  class: StringMatcher
+  patterns:
+    - "*"
+  prefix: editor-
+
+---
+BASIC:
+  id: entryscape-list
+  label: Entryscape (list)
+  class: FileBasedMessageGroup
+
+FILES:
+  class: AmdFFS
+  definitionFile: "%GROUPROOT%/entryscape/list.js"
+  sourcePattern: "%GROUPROOT%/entryscape/%CODE%/list.js"
+
+MANGLER:
+  class: StringMatcher
+  patterns:
+    - "*"
+  prefix: list-
+
+---
+BASIC:
+  id: entryscape-login
+  label: Entryscape (login)
+  class: FileBasedMessageGroup
+
+FILES:
+  class: AmdFFS
+  definitionFile: "%GROUPROOT%/entryscape/login.js"
+  sourcePattern: "%GROUPROOT%/entryscape/%CODE%/login.js"
+
+MANGLER:
+  class: StringMatcher
+  patterns:
+    - "*"
+  prefix: login-
+
+---
+BASIC:
+  id: entryscape-navigation
+  label: Entryscape (navigation)
+  class: FileBasedMessageGroup
+
+FILES:
+  class: AmdFFS
+  definitionFile: "%GROUPROOT%/entryscape/navigation.js"
+  sourcePattern: "%GROUPROOT%/entryscape/%CODE%/navigation.js"
+
+MANGLER:
+  class: StringMatcher
+  patterns:
+    - "*"
+  prefix: navigation-
+
+---
+BASIC:
+  id: entryscape-profile
+  label: Entryscape (profile)
+  class: FileBasedMessageGroup
+
+FILES:
+  class: AmdFFS
+  definitionFile: "%GROUPROOT%/entryscape/profile.js"
+  sourcePattern: "%GROUPROOT%/entryscape/%CODE%/profile.js"
+
+
+MANGLER:
+  class: StringMatcher
+  patterns:
+    - "*"
+  prefix: profile-
+
+---
+BASIC:
+  id: entryscape-settings
+  label: Entryscape (settings)
+  class: FileBasedMessageGroup
+
+FILES:
+  class: AmdFFS
+  definitionFile: "%GROUPROOT%/entryscape/settings.js"
+  sourcePattern: "%GROUPROOT%/entryscape/%CODE%/settings.js"
+
+MANGLER:
+  class: StringMatcher
+  patterns:
+    - "*"
+  prefix: settings-
+
+---
+BASIC:
+  id: entryscape-standard-dialog
+  label: Entryscape (standard dialog)
+  class: FileBasedMessageGroup
+
+FILES:
+  class: AmdFFS
+  definitionFile: "%GROUPROOT%/entryscape/standardDialog.js"
+  sourcePattern: "%GROUPROOT%/entryscape/%CODE%/standardDialog.js"
+
+MANGLER:
+  class: StringMatcher
+  patterns:
+    - "*"
+  prefix: standard-dialog-
+
+---
+BASIC:
+  id: entryscape-start
+  label: Entryscape (start)
+  class: FileBasedMessageGroup
+
+FILES:
+  class: AmdFFS
+  definitionFile: "%GROUPROOT%/entryscape/start.js"
+  sourcePattern: "%GROUPROOT%/entryscape/%CODE%/start.js"
+
+MANGLER:
+  class: StringMatcher
+  patterns:
+    - "*"
+  prefix: start-
diff --git a/groups/EntryScape/Suggester.php b/groups/EntryScape/Suggester.php
new file mode 100644
index 0000000..684c987
--- /dev/null
+++ b/groups/EntryScape/Suggester.php
@@ -0,0 +1,30 @@
+<?php
+/**
+ * @file
+ * @author Niklas Laxström
+ * @license GPL-2.0+
+ */
+
+class EntyScapeInsertablesSuggester {
+       public function getInsertables( $text ) {
+               $insertables = array();
+
+               // ${app}, {user}, %s
+               $matches = array();
+               preg_match_all( '/\$?{[^}]+}|%s/', $text, $matches, 
PREG_SET_ORDER );
+               $new = array_map( function( $match ) {
+                       return new Insertable( $match[0], $match[0] );
+               }, $matches );
+               $insertables = array_merge( $insertables, $new );
+
+               // &nbsp;
+               $matches = array();
+               preg_match_all( '/&(?:[a-z]+|#\d+);/', $text, $matches, 
PREG_SET_ORDER );
+               $new = array_map( function( $match ) {
+                       return new Insertable( $match[0], $match[0] );
+               }, $matches );
+               $insertables = array_merge( $insertables, $new );
+
+               return $insertables;
+       }
+}

-- 
To view, visit https://gerrit.wikimedia.org/r/213513
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I31921d83c4cafcb4854119908ed48557a0645a64
Gerrit-PatchSet: 8
Gerrit-Project: translatewiki
Gerrit-Branch: master
Gerrit-Owner: Nikerabbit <niklas.laxst...@gmail.com>
Gerrit-Reviewer: Nemo bis <federicol...@tiscali.it>
Gerrit-Reviewer: Nikerabbit <niklas.laxst...@gmail.com>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to