]> git.joonet.de Git - adminer.git/commitdiff
AdminerSqlGemini: Add Czech translation
authorJakub Vrana <jakub@vrana.cz>
Fri, 4 Apr 2025 16:52:18 +0000 (18:52 +0200)
committerJakub Vrana <jakub@vrana.cz>
Fri, 4 Apr 2025 16:52:18 +0000 (18:52 +0200)
plugins/sql-gemini.php

index b1f50e6af069c51bba41ee2253d70b579a88a662..23cd27ed740cbd00347d4b84070df6cb841ce24b 100644 (file)
@@ -50,7 +50,7 @@ class AdminerSqlGemini {
        }
 
        function sqlPrintAfter() {
-               echo "<p><textarea name='gemini' rows='5' cols='50' placeholder='Ask Gemini'>" . Adminer\h($_POST["gemini"]) . "</textarea>\n";
+               echo "<p><textarea name='gemini' rows='5' cols='50' placeholder='" . $this->lang('Ask Gemini') . "'>" . Adminer\h($_POST["gemini"]) . "</textarea>\n";
                ?>
 <p><input type='button' value='Gemini'>
 <script <?php echo Adminer\nonce(); ?>>
@@ -64,7 +64,7 @@ function setSqlareaValue(value) {
 }
 
 geminiButton.onclick = () => {
-       setSqlareaValue('-- Just a sec...'); // this is the phrase used by Google Gemini
+       setSqlareaValue('-- <?php echo $this->lang('Just a sec...'); ?>'); // this is the phrase used by Google Gemini
        ajax(
                '',
                req => setSqlareaValue(req.responseText),
@@ -91,4 +91,15 @@ geminiText.onkeydown = event => {
 </script>
 <?php
        }
+
+       private function lang($idf, $number = null) {
+               return Adminer\lang_format(Adminer\idx(self::$translations[Adminer\LANG], $idf) ?: $idf, $number);
+       }
+
+       private static $translations = array(
+               'cs' => array(
+                       'Ask Gemini' => 'Zeptat se Gemini',
+                       'Just a sec...' => 'Chviličku...',
+               ),
+       );
 }