summaryrefslogtreecommitdiffstats
path: root/lib/l10n/string.php
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2013-09-25 13:36:30 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2013-09-30 16:36:59 +0200
commit9c9dc276b7a1d2592c4fb0a887888632dc1f1e29 (patch)
treebbe3aed3e09c31c68806bdb8acffef70ba08f51c /lib/l10n/string.php
parenta711399e62d5a9f14d4b748efe4354ee37e61f13 (diff)
downloadnextcloud-server-9c9dc276b7a1d2592c4fb0a887888632dc1f1e29.tar.gz
nextcloud-server-9c9dc276b7a1d2592c4fb0a887888632dc1f1e29.zip
move the private namespace OC into lib/private - OCP will stay in lib/public
Conflicts: lib/private/vcategories.php
Diffstat (limited to 'lib/l10n/string.php')
-rw-r--r--lib/l10n/string.php56
1 files changed, 0 insertions, 56 deletions
diff --git a/lib/l10n/string.php b/lib/l10n/string.php
deleted file mode 100644
index 88c85b32e70..00000000000
--- a/lib/l10n/string.php
+++ /dev/null
@@ -1,56 +0,0 @@
-<?php
-/**
- * Copyright (c) 2012 Bart Visscher <bartv@thisnet.nl>
- * This file is licensed under the Affero General Public License version 3 or
- * later.
- * See the COPYING-README file.
- */
-
-class OC_L10N_String{
- /**
- * @var OC_L10N
- */
- protected $l10n;
-
- /**
- * @var string
- */
- protected $text;
-
- /**
- * @var array
- */
- protected $parameters;
-
- /**
- * @var integer
- */
- protected $count;
-
- public function __construct($l10n, $text, $parameters, $count = 1) {
- $this->l10n = $l10n;
- $this->text = $text;
- $this->parameters = $parameters;
- $this->count = $count;
- }
-
- public function __toString() {
- $translations = $this->l10n->getTranslations();
-
- $text = $this->text;
- if(array_key_exists($this->text, $translations)) {
- if(is_array($translations[$this->text])) {
- $fn = $this->l10n->getPluralFormFunction();
- $id = $fn($this->count);
- $text = $translations[$this->text][$id];
- }
- else{
- $text = $translations[$this->text];
- }
- }
-
- // Replace %n first (won't interfere with vsprintf)
- $text = str_replace('%n', $this->count, $text);
- return vsprintf($text, $this->parameters);
- }
-}