From 3cadac4094147e3edbfe8dd273cddcf5f7833d91 Mon Sep 17 00:00:00 2001 From: kolaente Date: Sun, 3 Jul 2016 15:53:35 +0200 Subject: [PATCH] Added: Add Languagestrings dynamically via function --- examples/example.php | 6 +++++- lang.class.php | 6 ++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/examples/example.php b/examples/example.php index 2557674..fe1631e 100644 --- a/examples/example.php +++ b/examples/example.php @@ -16,4 +16,8 @@ echo $lang->get('fail'); echo '
';
 print_r($lang->getAll());
-echo '
'; \ No newline at end of file +echo ''; + +$lang->set('Test in english', 'test', 'en'); +$lang->set('Test auf Deutsch', 'test', 'de'); +echo $lang->get('test'); \ No newline at end of file diff --git a/lang.class.php b/lang.class.php index 09ee481..6f561c3 100644 --- a/lang.class.php +++ b/lang.class.php @@ -117,4 +117,10 @@ class lang } } } + + //Set Langstrings + function set($string, $identifier, $lang) + { + $this->langfiles[$lang]['langstrings'][$identifier] = $string; + } } \ No newline at end of file