summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSolomon Peachy <pizza@shaftnet.org>2021-12-17 10:41:27 -0500
committerSolomon Peachy <pizza@shaftnet.org>2021-12-17 10:41:27 -0500
commit7f1ee2dec261b44f7ef83943b2fc9ab42542e1e1 (patch)
tree7f56dbd0cf45ad3dc282927d373a369555aa028b
parentaa276705fd78be3aa77551acd10e8b6616f3f8e8 (diff)
downloadtranslate-7f1ee2dec261b44f7ef83943b2fc9ab42542e1e1.tar.gz
translate-7f1ee2dec261b44f7ef83943b2fc9ab42542e1e1.zip
editing: Allow all fields to be edited, not just ones with flagged errors.
-rw-r--r--common.php5
-rw-r--r--edit.php8
2 files changed, 8 insertions, 5 deletions
diff --git a/common.php b/common.php
index 0d5bb11..9d18e5f 100644
--- a/common.php
+++ b/common.php
@@ -34,7 +34,7 @@ function languageinfo() {
return parse_ini_file('languages.ini', true);
}
-function parselangfile($filename) {
+function parselangfile($filename, $all = false) {
$lines = @file($filename);
if (!is_array($lines)) {
return false;
@@ -53,6 +53,9 @@ function parselangfile($filename) {
foreach($lines as $lineno => $line) {
$line = trim($line);
+ if ($all == true) {
+ $thisphrase['notes'][0] = "All fields are editable";
+ }
if (preg_match("/^### (.*)$/", $line, $matches)) {
if (strpos($matches[1], "The phrase is not used. Skipped") === false) {
$thisphrase['notes'][] = $matches[1];
diff --git a/edit.php b/edit.php
index 04c0460..cc5c118 100644
--- a/edit.php
+++ b/edit.php
@@ -21,7 +21,7 @@
error_reporting(E_ALL);
require_once('common.php');
-function edit($lang) {
+function edit($lang, $all = false) {
$languageinfo = languageinfo();
$LARGE_FLAGSIZE = LARGE_FLAGSIZE;
echo <<<END
@@ -46,8 +46,8 @@ translation as well.
<input type="hidden" name="lang" value="$lang" />
END;
- $phrases = parselangfile(sprintf("scratch/%s.lang.update", $lang));
- $english = parselangfile(sprintf("scratch/%s.lang.update", 'english'));
+ $phrases = parselangfile(sprintf("scratch/%s.lang.update", $lang), $all);
+ $english = parselangfile(sprintf("scratch/%s.lang.update", 'english'), $all);
if ($phrases === false || $english === false) {
printf("<strong>The file %s.lang doesn't exist, or something else went terribly wrong</strong>", $lang);
return false;
@@ -176,6 +176,6 @@ END;
}
print_head();
-edit($_REQUEST['lang']);
+edit($_REQUEST['lang'], $_REQUEST['all']);
print_foot();
?>