+ $ret = str_replace(['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
+ [$this->t('Mon'), $this->t('Tue'), $this->t('Wed'), $this->t('Thu'), $this->t('Fri'), $this->t('Sat'), $this->t('Sun')],
+ $s);
+
+ $ret = str_replace(['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
+ [$this->t('Jan'), $this->t('Feb'), $this->t('Mar'), $this->t('Apr'), $this->t('May'), $this->t('Jun'), $this->t('Jul'), $this->t('Aug'), $this->t('Sep'), $this->t('Oct'), $this->t('Nov'), $this->t('Dec')],
+ $ret);
+
+ return $ret;
+ }
+
+ /**
+ * Load poke verbs
+ *
+ * @return array index is present tense verb
+ * value is array containing past tense verb, translation of present, translation of past
+ * @throws \Friendica\Network\HTTPException\InternalServerErrorException
+ * @hook poke_verbs pokes array
+ */
+ public function getPokeVerbs()
+ {
+ // index is present tense verb
+ // value is array containing past tense verb, translation of present, translation of past
+ $arr = [
+ 'poke' => ['poked', $this->t('poke'), $this->t('poked')],
+ 'ping' => ['pinged', $this->t('ping'), $this->t('pinged')],
+ 'prod' => ['prodded', $this->t('prod'), $this->t('prodded')],
+ 'slap' => ['slapped', $this->t('slap'), $this->t('slapped')],
+ 'finger' => ['fingered', $this->t('finger'), $this->t('fingered')],
+ 'rebuff' => ['rebuffed', $this->t('rebuff'), $this->t('rebuffed')],
+ ];
+
+ Hook::callAll('poke_verbs', $arr);
+
+ return $arr;
+ }
+
+ /**
+ * Creates a new L10n instance based on the given langauge
+ *
+ * @param string $lang The new language
+ *
+ * @return static A new L10n instance
+ * @throws \Exception
+ */
+ public function withLang(string $lang)
+ {
+ // Don't create a new instance for same language
+ if ($lang === $this->lang) {
+ return $this;
+ }
+
+ $newL10n = clone $this;
+ $newL10n->loadTranslationTable($lang);
+ return $newL10n;