Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/nextcloud.com.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukas Reschke <lukas@statuscode.ch>2016-10-21 13:19:59 +0300
committerLukas Reschke <lukas@statuscode.ch>2016-10-21 13:19:59 +0300
commit9ec2f19e26b9d0736bd1c341bb7069b51e284296 (patch)
tree539957a8c0f6eed8312328d1d7653c7116de74f3 /l10n.php
parent116719decccd6e2f17568ac2a365d0468d3a7273 (diff)
Use hash as key
Diffstat (limited to 'l10n.php')
-rw-r--r--l10n.php12
1 files changed, 7 insertions, 5 deletions
diff --git a/l10n.php b/l10n.php
index 5dd388f0..fc325be2 100644
--- a/l10n.php
+++ b/l10n.php
@@ -57,23 +57,25 @@ class L10N {
file_put_contents($baseTranslationFile, json_encode([]));
}
+ $stringHash = md5($string);
+
// If the string doesn't yet exist to translate: Create it
if($this->baseTranslations === null) {
$this->baseTranslations= json_decode(file_get_contents($baseTranslationFile), true);
$this->countBefore = count($this->baseTranslations);
- if (!isset($this->baseTranslations[$string])) {
- $this->baseTranslations[$string] = $string;
+ if (!isset($this->baseTranslations[$stringHash])) {
+ $this->baseTranslations[$stringHash] = $string;
$this->changed = true;
}
}
- $this->requestedStrings[$string] = $string;
+ $this->requestedStrings[$stringHash] = $string;
// Read the translated string
$translationFile = __DIR__ . '/l10n/'.$this->getCurrentLanguage().'/' . $this->pageName . '.json';
if(file_exists($translationFile)) {
$translations = json_decode(file_get_contents($translationFile), true);
- if(isset($translations[$string])) {
- return $translations[$string];
+ if(isset($translations[$stringHash])) {
+ return $translations[$stringHash];
}
}