Page MenuHomePhabricator

D11746.id.diff
No OneTemporary

D11746.id.diff

diff --git a/scripts/__init_script__.php b/scripts/__init_script__.php
--- a/scripts/__init_script__.php
+++ b/scripts/__init_script__.php
@@ -51,58 +51,8 @@
exit(1);
}
-PhutilTranslator::getInstance()
- ->addTranslations(array(
- '%s locally modified path(s) are not included in this revision:' => array(
- 'A locally modified path is not included in this revision:',
- 'Locally modified paths are not included in this revision:',
- ),
- 'These %s path(s) will NOT be committed. Commit this revision '.
- 'anyway?' => array(
- 'This path will NOT be committed. Commit this revision anyway?',
- 'These paths will NOT be committed. Commit this revision anyway?',
- ),
- 'Revision includes changes to %s path(s) that do not exist:' => array(
- 'Revision includes changes to a path that does not exist:',
- 'Revision includes changes to paths that do not exist:',
- ),
-
- 'This diff includes %s file(s) which are not valid UTF-8 (they contain '.
- 'invalid byte sequences). You can either stop this workflow and fix '.
- 'these files, or continue. If you continue, these files will be '.
- 'marked as binary.' => array(
- 'This diff includes a file which is not valid UTF-8 (it has invalid '.
- 'byte sequences). You can either stop this workflow and fix it, or '.
- 'continue. If you continue, this file will be marked as binary.',
- 'This diff includes files which are not valid UTF-8 (they contain '.
- 'invalid byte sequences). You can either stop this workflow and fix '.
- 'these files, or continue. If you continue, these files will be '.
- 'marked as binary.',
- ),
- '%d AFFECTED FILE(S)' => array('AFFECTED FILE', 'AFFECTED FILES'),
- 'Do you want to mark these %s file(s) as binary and continue?' => array(
- 'Do you want to mark this file as binary and continue?',
- 'Do you want to mark these files as binary and continue?',
- ),
-
- 'Do you want to amend these %s file(s) to the commit?' => array(
- 'Do you want to amend this file to the commit?',
- 'Do you want to amend these files to the commit?',
- ),
-
- 'Do you want to add these %s file(s) to the commit?' => array(
- 'Do you want to add this file to the commit?',
- 'Do you want to add these files to the commit?',
- ),
-
- '%s line(s)' => array('line', 'lines'),
-
- '%d test(s)' => array('%d test', '%d tests'),
-
- '%d assertion(s) passed.' => array(
- '%d assertion passed.',
- '%d assertions passed.',
- ),
- ));
-
phutil_load_library(dirname(dirname(__FILE__)).'/src/');
+
+PhutilTranslator::getInstance()
+ ->setLocale(PhutilLocale::loadLocale('en_US'))
+ ->setTranslations(PhutilTranslation::getTranslationMapForLocale('en_US'));
diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php
--- a/src/__phutil_library_map__.php
+++ b/src/__phutil_library_map__.php
@@ -184,6 +184,7 @@
'ArcanistTextLinterTestCase' => 'lint/linter/__tests__/ArcanistTextLinterTestCase.php',
'ArcanistTimeWorkflow' => 'workflow/ArcanistTimeWorkflow.php',
'ArcanistTodoWorkflow' => 'workflow/ArcanistTodoWorkflow.php',
+ 'ArcanistUSEnglishTranslation' => 'internationalization/ArcanistUSEnglishTranslation.php',
'ArcanistUncommittedChangesException' => 'exception/usage/ArcanistUncommittedChangesException.php',
'ArcanistUnitConsoleRenderer' => 'unit/renderer/ArcanistUnitConsoleRenderer.php',
'ArcanistUnitRenderer' => 'unit/renderer/ArcanistUnitRenderer.php',
@@ -367,6 +368,7 @@
'ArcanistTextLinterTestCase' => 'ArcanistLinterTestCase',
'ArcanistTimeWorkflow' => 'ArcanistPhrequentWorkflow',
'ArcanistTodoWorkflow' => 'ArcanistWorkflow',
+ 'ArcanistUSEnglishTranslation' => 'PhutilTranslation',
'ArcanistUncommittedChangesException' => 'ArcanistUsageException',
'ArcanistUnitConsoleRenderer' => 'ArcanistUnitRenderer',
'ArcanistUnitTestableLintEngine' => 'ArcanistLintEngine',
diff --git a/src/internationalization/ArcanistUSEnglishTranslation.php b/src/internationalization/ArcanistUSEnglishTranslation.php
new file mode 100644
--- /dev/null
+++ b/src/internationalization/ArcanistUSEnglishTranslation.php
@@ -0,0 +1,64 @@
+<?php
+
+final class ArcanistUSEnglishTranslation extends PhutilTranslation {
+
+ public function getLocaleCode() {
+ return 'en_US';
+ }
+
+ protected function getTranslations() {
+ return array(
+ '%s locally modified path(s) are not included in this revision:' => array(
+ 'A locally modified path is not included in this revision:',
+ 'Locally modified paths are not included in this revision:',
+ ),
+ 'These %s path(s) will NOT be committed. Commit this revision '.
+ 'anyway?' => array(
+ 'This path will NOT be committed. Commit this revision anyway?',
+ 'These paths will NOT be committed. Commit this revision anyway?',
+ ),
+ 'Revision includes changes to %s path(s) that do not exist:' => array(
+ 'Revision includes changes to a path that does not exist:',
+ 'Revision includes changes to paths that do not exist:',
+ ),
+
+ 'This diff includes %s file(s) which are not valid UTF-8 (they contain '.
+ 'invalid byte sequences). You can either stop this workflow and fix '.
+ 'these files, or continue. If you continue, these files will be '.
+ 'marked as binary.' => array(
+ 'This diff includes a file which is not valid UTF-8 (it has invalid '.
+ 'byte sequences). You can either stop this workflow and fix it, or '.
+ 'continue. If you continue, this file will be marked as binary.',
+ 'This diff includes files which are not valid UTF-8 (they contain '.
+ 'invalid byte sequences). You can either stop this workflow and fix '.
+ 'these files, or continue. If you continue, these files will be '.
+ 'marked as binary.',
+ ),
+ '%d AFFECTED FILE(S)' => array('AFFECTED FILE', 'AFFECTED FILES'),
+ 'Do you want to mark these %s file(s) as binary and continue?' => array(
+ 'Do you want to mark this file as binary and continue?',
+ 'Do you want to mark these files as binary and continue?',
+ ),
+
+ 'Do you want to amend these %s file(s) to the commit?' => array(
+ 'Do you want to amend this file to the commit?',
+ 'Do you want to amend these files to the commit?',
+ ),
+
+ 'Do you want to add these %s file(s) to the commit?' => array(
+ 'Do you want to add this file to the commit?',
+ 'Do you want to add these files to the commit?',
+ ),
+
+ '%s line(s)' => array('line', 'lines'),
+
+ '%d test(s)' => array('%d test', '%d tests'),
+
+ '%d assertion(s) passed.' => array(
+ '%d assertion passed.',
+ '%d assertions passed.',
+ ),
+ );
+ }
+
+}

File Metadata

Mime Type
text/plain
Expires
Wed, Mar 5, 4:43 AM (3 w, 1 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7223567
Default Alt Text
D11746.id.diff (6 KB)

Event Timeline