]> 91.132.146.200 Git - bibliotheca-php.git/commitdiff
i18n messages from php files
authorBanana <mail@bananas-playground.net>
Fri, 19 Apr 2024 19:16:59 +0000 (21:16 +0200)
committerBanana <mail@bananas-playground.net>
Fri, 19 Apr 2024 19:16:59 +0000 (21:16 +0200)
Signed-off-by: Banana <mail@bananas-playground.net>
22 files changed:
TODO
webclient/i18n/eng.ini
webclient/view/compact/managetags/managetags.html
webclient/view/default/advancedsearch/advancedsearch.php
webclient/view/default/auth/auth.php
webclient/view/default/bulkedit/bulkedit.php
webclient/view/default/collections/collections.php
webclient/view/default/entry/entry.php
webclient/view/default/managecollectionfields/managecollectionfields.php
webclient/view/default/managecolletions/managecolletions.html
webclient/view/default/managecolletions/managecolletions.php
webclient/view/default/manageentry/manageentry.php
webclient/view/default/managegroups/managegroups.php
webclient/view/default/managetags/managetags.php
webclient/view/default/manageusers/manageusers.php
webclient/view/default/profile/profile.php
webclient/view/default/system/menu.php
webclient/view/default/tags/tags.php
webclient/view/default/tool/tool-googlebooks.php
webclient/view/default/tool/tool-imdbweb.php
webclient/view/default/tool/tool-musicbrainz.php
webclient/view/default/tool/tool.php

diff --git a/TODO b/TODO
index d2af478c6db65fa4e9bb9aa8641d9b9f69172e79..78e05111280fdbae29e4b11402d87b292cf0803e 100644 (file)
--- a/TODO
+++ b/TODO
@@ -6,3 +6,5 @@
 
 * update JS and remove deprecations
 * Definition of fields in "card view"
+
+* language setting in setup
index 3735e170164d225778c34ce89723375e21df8fa2..5ce40b0bffb96d8ff3cc30faec0df9a9f5506d4f 100644 (file)
@@ -40,6 +40,14 @@ global.group = "Group"
 global.image = "Image"
 global.latest = "Latest"
 global.login = "Login"
+global.message.couldNotBeSaved = "Data could not be saved. See logs for more."
+global.message.couldNotLoadCollection = "Can not load given collection."
+global.message.dataSaved = "Data saved successfully"
+global.message.here = "Here"
+global.message.invalidSearchTerm = "Invalid search term"
+global.message.missingQueryParams = "Missing required query parameters."
+global.message.nothingFound = "Nothing found."
+global.message.somethingWentWrong = "Something went wrong. See logs for more details."
 global.name = "Name"
 global.none = "None"
 global.none = "None"
@@ -67,6 +75,7 @@ advsearch.input.description = "This uses the table view as default. Remember to
 advsearch.input.search.label = "Search for"
 advsearch.input.search.placeholder = "See search syntax for options"
 advsearch.input.tableview.label = "Table view"
+advsearch.message.wrongInputFormat = "Wrong input format."
 advsearch.operators = "Possible search operators:"
 advsearch.operators.asterisk = "The asterisk serves as the truncation (or wildcard) operator. Unlike the other operators, it is appended to the word to be affected. Words match if they begin with the word preceding the * operator."
 advsearch.operators.greater = "A leading greater than sign indicates that rows greater than the number will be returned."
@@ -80,8 +89,13 @@ advsearch.tableview.description = "Make sure to define the fields which will be
 advsearch.togglesearch = "Toggle search"
 
 auth.logout = "Logout"
+auth.message.invalidInput = "Invalid username or password."
+auth.message.missingInput = "Please provide valid e-Mail and password."
 
 bulkedit.headline.edit = "Bulkedit these entries in:"
+bulkedit.message.canNotUpdate = "Entry could not be updated. See log for more details:"
+bulkedit.message.entryUpdated = "Entry updated:"
+bulkedit.message.missingItems = "Missing required search items to work with."
 
 managecol.addmodify = "Add or modify a collection"
 managecol.addremfield = "Add or remove a field"
@@ -108,10 +122,21 @@ managecol.input.overwriterights.howto = "Warning: This will overwrite existing e
 managecol.input.tools = "Tools"
 managecol.managecol = "Manage your collections"
 managecol.managefields = "Manage your fields for:"
+managecol.message.couldNotBeDelete = "Collection could not be deleted."
+managecol.message.couldNotBeUpdated = "Collection could not be updated."
+managecol.message.missingRights = "Provide name, owner, group and valid rights."
+managecol.message.notBeCreated = "Collection could not be created."
 
 manageentry.addentry = "Add an entry to:"
 manageentry.addentrycollection = "Add an entry to your collection"
 manageentry.availabletools = "Available tools"
+manageentry.message.couldNotBeAdded = "Entry could not be added."
+manageentry.message.couldNotBeRemoved = "Entry could not be removed."
+manageentry.message.couldNotBeUpdated = "Entry could not be updated."
+manageentry.message.editNewEntry = "Edit your new entry"
+manageentry.message.missingTitle = "Provide at least 'Title'."
+manageentry.message.noTitle = "Entry has no value in title field."
+manageentry.message.viewNewEntry = "View your new entry"
 manageentry.missingtemplate = "Missing template for:"
 manageentry.possibleduplicate = "Possible duplicate"
 manageentry.select.bulkedit = "Select bulk edit option"
@@ -125,19 +150,27 @@ managefields.addorremove = "Add or remove a field"
 managefields.addorremove.description = "Just use drag and drop below to add, remove or order your fields.<br />Removing a field will <b>remove</b> the stored data from the collection.<br />Make sure at least the <b>title</b>, <b>cover image</b> and <b>description</b> fields are available."
 managefields.fieldsavailable = "Available fields"
 managefields.fieldsfor = "Manage your fields for:"
+managefields.message.notUpdate = "Fields could not be updated."
+managefields.message.provideValidFields = "Please provide valid fields."
 
-managegroups.groupmanagement = "Group management"
 managegroups.addormodify = "Add or modify a group"
+managegroups.availablegroups = "Available groups"
+managegroups.groupmanagement = "Group management"
+managegroups.input.delete = global.delete
+managegroups.input.delete.howto = "Warning: Content owned by this group will not be deleted and thus only manageable by admin!<br />Right now don't do this. Only if you are sure there is no usage of this group."
 managegroups.input.description = global.description
 managegroups.input.name = global.name
-managegroups.input.delete = global.delete
 managegroups.input.save = global.save
-managegroups.input.delete.howto = "Warning: Content owned by this group will not be deleted and thus only manageable by admin!<br />Right now don't do this. Only if you are sure there is no usage of this group."
-managegroups.availablegroups = "Available groups"
+managegroups.message.couldNotBeCreated = "Group could not be created."
+managegroups.message.couldNotBeDelete = "Group could not be deleted."
+managegroups.message.couldNotBeUpdated = "Group could not be updated. Either wrong input or duplicate group name"
+managegroups.message.missingName = "Provide name and description."
 
 managetags.delete = global.delete
 managetags.howto = "The actions are top down. If you choose to move and rename, only move will be executed.<br />Deletion will remove without recover!<br />If you rename and input an existing one a move will be done instead.<br />Tag values are stored how they come and treated that way here (case sensitive). In search they are case insensitive."
 managetags.managetagsin = "Manage Tags in:"
+managetags.message.executionError = "Can not execute given options. See logs for more."
+managetags.message.notTagsAvailable = "No tags available or something went wrong."
 managetags.moveorrename = "Move to (rename to existig)"
 managetags.rename = "Rename"
 managetags.tagfield = "Tagfield"
@@ -155,6 +188,10 @@ manageuser.input.canloging = "Can login"
 manageuser.input.delete = global.delete
 manageuser.input.delete.howto = "Warning: Content owned by this user will not be deleted and thus only manageable by admin!<br />Better disable the user if there is content."
 manageuser.input.maingroup = "Main group"
+manageuser.message.couldNotBeCreated = "User could not be created."
+manageuser.message.couldNotBeDelete = "User could not be deleted. Make sure the user is not used anymore."
+manageuser.message.couldNotBeUpdated = "User could not be updated. Either wrong input or duplicate user name"
+manageuser.message.missingInput = "Provide username, login and a valid user group."
 manageuser.status = "Status"
 manageuser.usermanagement = "User management"
 
@@ -181,6 +218,7 @@ profile.input.apitoken.current = manageuser.input.apitoken.current
 profile.input.apitoken.valid = manageuser.input.apitoken.valid
 profile.input.createtoken = "Create API Token"
 profile.input.maingroup = "Main group"
+profile.message.couldNotBeUpdated = "Your profile could not be updated."
 profile.yourprofile = "Manage your profile"
 
 sysinfo.headline.sysinfo = "System information"
@@ -195,6 +233,4 @@ sysinfo.th.tags = "Tags"
 tags.headline.tagsfor = "Tags for:"
 
 tool.headline.using = "Using %s with collection: %s"
-
-
-
+tool.message.missingFiles = "Required tool files can not be found."
index cdafcb3a6d571520d806223c88b73aa2884ce3ce..9b93ceccb06fa4c8d2249f17e0056dbee515a3ea 100644 (file)
@@ -14,7 +14,7 @@
                                <label class="uk-form-label"><?php echo $I18n->t('managetags.user'); ?></label>
                                <div class="uk-form-controls">
                                        <select class="uk-select" name="fdata[<?php echo $v['id']; ?>][use]">
-                                               <option value="">Please select</option>
+                                               <option value=""><?php echo $I18n->t('global.pleaseselect'); ?></option>
                                                <?php foreach($v['entries'] as $ek=>$ev) { ?>
                                                <option value="<?php echo $ev; ?>"><?php echo $ev; ?></option>
                                                <?php } ?>
index db96a3fc7e157d73f17596088ae9ee02aad14001..ffa1c79689ca165a0bf6f98d6718ad90a03a82cc 100644 (file)
@@ -82,7 +82,7 @@ if(!empty($_collection)) {
                                                        $TemplateData['search'] = $_search;
                                                }
                                                else {
-                                                       $TemplateData['message']['content'] = "Wrong input format.";
+                                                       $TemplateData['message']['content'] = $I18n->t('advsearch.message.wrongInputFormat');
                                                        $TemplateData['message']['status'] = "error";
                                                }
                                        } else { // ordinary search within default field
@@ -102,7 +102,7 @@ if(!empty($_collection)) {
                }
        }
        else {
-               $TemplateData['message']['content'] = "Can not load given collection.";
+               $TemplateData['message']['content'] = $I18n->t('global.message.couldNotLoadCollection');
                $TemplateData['message']['status'] = "error";
        }
 }
index 611dc0bcef9ebc01230252f2727f576e88bf44f6..3e2e863ed1e3406cb56dafee5598c41b73dff094 100644 (file)
@@ -41,12 +41,12 @@ elseif(isset($_POST['submitForm'])) {
                                        $TemplateData['refresh'] = 'index.php';
                                }
                                else {
-                                       $TemplateData['message']['content'] = "Invalid username or password.";
+                                       $TemplateData['message']['content'] = $I18n->t('auth.message.invalidInput');
                                        $TemplateData['message']['status'] = "error";
                                }
                        }
                        else {
-                               $TemplateData['message']['content'] = "Please provide valid e-Mail and password.";
+                               $TemplateData['message']['content'] = $I18n->t('auth.message.missingInput');
                                $TemplateData['message']['status'] = "error";
                        }
                }
index 4060232f3a0275859c2e3a72fc836e39831ac985..d223abf1cde77ca8a25a6489da3a8fe4501516b3 100644 (file)
@@ -108,9 +108,9 @@ if(!empty($_collection)) {
 
                                                $do = $ManageEntry->create($_fieldsToSave, $_owner, $_group, $_rights, $entry['id']);
                                                if ($do !== 0) {
-                                                       $_messages[] = "Entry updated: ".$entry['id'];
+                                                       $_messages[] = $I18n->t('bulkedit.message.entryUpdated').' '.$entry['id'];
                                                } else {
-                                                       $_messages[] = "Entry could not be updated. See log for more details: ".$entry['id'];
+                                                       $_messages[] = $I18n->t('bulkedit.message.canNotUpdate').' '.$entry['id'];
                                                }
 
                                                unset($data);
@@ -122,12 +122,12 @@ if(!empty($_collection)) {
                        }
                }
                else {
-                       $TemplateData['message']['content'] = "Missing required search items to work with.";
+                       $TemplateData['message']['content'] = $I18n->t('bulkedit.message.missingItems');
                        $TemplateData['message']['status'] = "error";
                }
        }
        else {
-               $TemplateData['message']['content'] = "Can not load given collection.";
+               $TemplateData['message']['content'] = $I18n->t('global.message.couldNotLoadCollection');
                $TemplateData['message']['status'] = "error";
        }
 }
index aedec1eb5e0a126421e30bcb4eb468055b15d29c..be9fd738f1fb58b774ff03d2b414c6d9db5e6b7f 100644 (file)
@@ -154,7 +154,7 @@ if(!empty($_collection)) {
 
        }
        else {
-               $TemplateData['message']['content'] = "Can not load given collection.";
+               $TemplateData['message']['content'] = $I18n->t('global.message.couldNotLoadCollection');
                $TemplateData['message']['status'] = "error";
        }
 }
index e8e3bc6c59cda7b6dd560f518a9e513895098483..c8a67527198ab0a33a3dd8d41a85c8a58d94e651 100644 (file)
@@ -63,11 +63,11 @@ if(!empty($_collection) && !empty($_id)) {
                }
        }
        else {
-               $TemplateData['message']['content'] = 'Can not load given collection.';
+               $TemplateData['message']['content'] = $I18n->t('global.message.couldNotLoadCollection');
                $TemplateData['message']['status'] = 'error';
        }
 }
 else {
        $TemplateData['message']['status'] = 'error';
-       $TemplateData['message']['content'] = 'Missing required query parameters.';
+       $TemplateData['message']['content'] = $I18n->t('global.message.missingQueryParams');
 }
index f58446a6f03bf2c927b3964de22b1bcb9620af9c..66e23c93f9a2c029d31a8ed00063ae5438d188a6 100644 (file)
@@ -63,12 +63,12 @@ if(isset($_POST['submitForm'])) {
                        if ($do === true) {
                                $TemplateData['refresh'] = 'index.php?p=managecollectionfields&id='.$_id;
                        } else {
-                               $TemplateData['message']['content'] = "Fields could not be updated.";
+                               $TemplateData['message']['content'] = $I18n->t('managefields.message.notUpdate');
                                $TemplateData['message']['status'] = "error";
                        }
                }
                else {
-                       $TemplateData['message']['content'] = "Please provide valid fields.";
+                       $TemplateData['message']['content'] = $I18n->t('managefields.message.provideValidFields');
                        $TemplateData['message']['status'] = "error";
                }
        }
index 7325fcf246678159b17bba15d0799b2f1a2002dc..ec5e5a08d34801f7b20540781478d129bfd5dbf6 100644 (file)
@@ -82,7 +82,7 @@
                                </div>
                        </div>
                        <div class="uk-margin">
-                               <label class="uk-form-label" for="tool">Tools</label>
+                               <label class="uk-form-label" for="tool"><?php echo $I18n->t('managecol.input.tools'); ?></label>
                                <div class="uk-form-controls">
                                        <select class="uk-select" id="tool" name="fdata[tool][]" multiple="multiple" size="5">
                                                <option value=""><?php echo $I18n->t('global.none'); ?></option>
@@ -99,7 +99,7 @@
                                <label class="uk-form-label" for="owner"><?php echo $I18n->t('global.owner'); ?> *</label>
                                <div class="uk-form-controls">
                                        <select class="uk-select" id="owner" name="fdata[owner]">
-                                               <option value="">Please select</option>
+                                               <option value=""><?php echo $I18n->t('global.pleaseselect'); ?></option>
                                                <?php foreach($TemplateData['ownerSelection'] as $k=>$v) { ?>
                                                <option value="<?php echo $k; ?>"
                                                <?php echo ($TemplateData['editData']['owner'] ?? '') == $k ? 'selected' : ''; ?>
                                <label class="uk-form-label" for="group"><?php echo $I18n->t('global.group'); ?> *</label>
                                <div class="uk-form-controls">
                                        <select class="uk-select" id="group" name="fdata[group]">
-                                               <option value="">Please select</option>
+                                               <option value=""><?php echo $I18n->t('global.pleaseselect'); ?></option>
                                                <?php foreach($TemplateData['groupSelection'] as $k=>$v) { ?>
                                                <option value="<?php echo $k; ?>"
                                                        <?php echo ($TemplateData['editData']['group'] ?? '') == $k ? 'selected' : ''; ?>
index 68e85fb98aa81a8482546345ccc5ec5dc9a018cf..a4e8e794ef6a7b689a49ab9dc844555667b321ce 100644 (file)
@@ -100,7 +100,7 @@ if(isset($_POST['submitForm'])) {
                                if ($do === true) {
                                        $TemplateData['refresh'] = 'index.php?p=managecolletions';
                                } else {
-                                       $TemplateData['message']['content'] = "Collection could not be deleted.";
+                                       $TemplateData['message']['content'] = $I18n->t('managecol.message.couldNotBeDelete');
                                        $TemplateData['message']['status'] = "error";
                                }
                        }
@@ -116,11 +116,11 @@ if(isset($_POST['submitForm'])) {
                         }
                                                $TemplateData['refresh'] = 'index.php?p=managecolletions';
                                        } else {
-                                               $TemplateData['message']['content'] = "Collection could not be updated.";
+                                               $TemplateData['message']['content'] = $I18n->t('managecol.message.couldNotBeUpdated');
                                                $TemplateData['message']['status'] = "error";
                                        }
                                } else {
-                                       $TemplateData['message']['content'] = "Provide name, owner, group and valid rights.";
+                                       $TemplateData['message']['content'] = $I18n->t('managecol.message.missingRights');
                                        $TemplateData['message']['status'] = "error";
                                }
                        }
@@ -135,11 +135,11 @@ if(isset($_POST['submitForm'])) {
                                        if ($do === true) {
                                                $TemplateData['refresh'] = 'index.php?p=managecolletions';
                                        } else {
-                                               $TemplateData['message']['content'] = "Collection could not be created.";
+                                               $TemplateData['message']['content'] = $I18n->t('managecol.message.notBeCreated');
                                                $TemplateData['message']['status'] = "error";
                                        }
                                } else {
-                                       $TemplateData['message']['content'] = "Provide name, owner, group and valid rights.";
+                                       $TemplateData['message']['content'] = $I18n->t('managecol.message.missingRights');
                                        $TemplateData['message']['status'] = "error";
                                }
                        }
index 498aacdbac7fd40c5a2eca5c16e3f704aca8f891..9c722d15b54c653d4c695c9eba1e59693d2abd0f 100644 (file)
@@ -63,7 +63,7 @@ if(!empty($_collection)) {
                        $TemplateData['editData'] = $ManageEntry->getEditData($_id);
                        // special case. Title field should be always available.
                        if(!isset($TemplateData['editData']['title'])) {
-                               $TemplateData['message']['content'] = "Entry has no value in title field.";
+                               $TemplateData['message']['content'] = $I18n->t('manageentry.message.noTitle');
                                $TemplateData['message']['status'] = "error";
                        }
                        else {
@@ -116,7 +116,7 @@ if(!empty($_collection)) {
                                                if ($do === true) {
                                                        $TemplateData['refresh'] = 'index.php?p=collections&collection='.$_collection;
                                                } else {
-                                                       $TemplateData['message']['content'] = "Entry could not be removed.";
+                                                       $TemplateData['message']['content'] = $I18n->t('manageentry.message.couldNotBeRemoved');
                                                        $TemplateData['message']['status'] = "error";
                                                }
                                        } elseif (!empty($_fieldsToSave) && isset($_fieldsToSave['title'])) {
@@ -124,7 +124,7 @@ if(!empty($_collection)) {
                                                if ($do !== 0) {
                                                        $TemplateData['refresh'] = 'index.php?p=entry&collection='.$_collection.'&id='.$_id;
                                                } else {
-                                                       $TemplateData['message']['content'] = "Entry could not be updated.";
+                                                       $TemplateData['message']['content'] = $I18n->t('manageentry.message.couldNotBeUpdated');
                                                        $TemplateData['message']['status'] = "error";
                                                }
                                        }
@@ -134,18 +134,19 @@ if(!empty($_collection)) {
                                        if (!empty($_fieldsToSave) && !empty($_fieldsToSave['title']['valueToSave'])) {
                                                $do = $ManageEntry->create($_fieldsToSave, $_owner, $_group, $_rights);
                                                if (!empty($do)) {
-                                                       $TemplateData['message']['content'] = "<a href='index.php?p=entry&collection=".$_collection."&id=".$do."'>View your new entry</a> | <a href='index.php?p=manageentry&collection=".$_collection."&id=".$do."'>Edit your new entry</a>";
+                                                       $TemplateData['message']['content'] = "<a href='index.php?p=entry&collection=".$_collection."&id=".$do."'>".$I18n->t('manageentry.message.viewNewEntry')."</a> 
+                                                                    | <a href='index.php?p=manageentry&collection=".$_collection."&id=".$do."'>".$I18n->t('manageentry.message.editNewEntry')."</a>";
                                                        $TemplateData['message']['status'] = "success";
                                                } else {
                                                        // use editData to display given data
                                                        $TemplateData['editData'] = $fdata;
-                                                       $TemplateData['message']['content'] = "Entry could not be added.";
+                                                       $TemplateData['message']['content'] = $I18n->t('manageentry.message.couldNotBeAdded');
                                                        $TemplateData['message']['status'] = "error";
                                                }
                                        } else {
                                                // use editData to display given data
                                                $TemplateData['editData'] = $fdata;
-                                               $TemplateData['message']['content'] = "Provide at least 'Title'.";
+                                               $TemplateData['message']['content'] = $I18n->t('manageentry.message.missingTitle');
                                                $TemplateData['message']['status'] = "error";
                                        }
                                }
@@ -153,7 +154,7 @@ if(!empty($_collection)) {
                }
        }
        else {
-               $TemplateData['message']['content'] = "Collection could not be loaded.";
+               $TemplateData['message']['content'] = $I18n->t('global.message.couldNotLoadCollection');
                $TemplateData['message']['status'] = "error";
                $TemplateData['existingCollections'] = $Trite->getCollections("write");
        }
index 480f72605c8c3708cfa4791b5bb6bb0e521551da..623325498e78ebd8341dc38eca87280e701a1499 100644 (file)
@@ -51,7 +51,7 @@ if(isset($_POST['submitForm'])) {
                                        $TemplateData['refresh'] = 'index.php?p=managegroups';
                                }
                                else {
-                                       $TemplateData['message']['content'] = "Group could not be deleted.";
+                                       $TemplateData['message']['content'] = $I18n->t('managegroups.message.couldNotBeDelete');
                                        $TemplateData['message']['status'] = "error";
                                }
                        }
@@ -61,12 +61,12 @@ if(isset($_POST['submitForm'])) {
                                        $TemplateData['refresh'] = 'index.php?p=managegroups';
                                }
                                else {
-                                       $TemplateData['message']['content'] = "Group could not be updated. Either wrong input or duplicate group name";
+                                       $TemplateData['message']['content'] = $I18n->t('managegroups.message.couldNotBeUpdated');
                                        $TemplateData['message']['status'] = "error";
                                }
                        }
                        else {
-                               $TemplateData['message']['content'] = "Provide name and description.";
+                               $TemplateData['message']['content'] = $I18n->t('managegroups.message.missingName');
                                $TemplateData['message']['status'] = "error";
                        }
                }
@@ -77,12 +77,12 @@ if(isset($_POST['submitForm'])) {
                                        $TemplateData['refresh'] = 'index.php?p=managegroups';
                                }
                                else {
-                                       $TemplateData['message']['content'] = "Group could not be created.";
+                                       $TemplateData['message']['content'] = $I18n->t('managegroups.message.couldNotBeCreated');
                                        $TemplateData['message']['status'] = "error";
                                }
                        }
                        else {
-                               $TemplateData['message']['content'] = "Provide name and description.";
+                               $TemplateData['message']['content'] = $I18n->t('managegroups.message.missingName');
                                $TemplateData['message']['status'] = "error";
                        }
                }
index 2e85d6450648872a174e70c6781f512d6e4156d0..d6dac63bd74cc67d4d824acee99ad2ac79ce3f8b 100644 (file)
@@ -61,20 +61,20 @@ if(!empty($_collection)) {
                                }
                        }
                        else {
-                               $TemplateData['message']['content'] = "Can not execute given options. See logs for more.";
+                               $TemplateData['message']['content'] = $I18n->t('managetags.message.executionError');
                                $TemplateData['message']['status'] = "error";
                        }
                }
                else {
                        $TemplateData['tags'] = $Trite->getTags();
                        if(empty($TemplateData['tags'])) {
-                               $TemplateData['message']['content'] = "No tags available or something went wrong.";
+                               $TemplateData['message']['content'] = $I18n->t('managetags.message.notTagsAvailable');
                                $TemplateData['message']['status'] = "warning";
                        }
                }
        }
        else {
-               $TemplateData['message']['content'] = "Can not load given collection.";
+               $TemplateData['message']['content'] = $I18n->t('global.message.couldNotLoadCollection');
                $TemplateData['message']['status'] = "error";
        }
 }
index 547ad7fdb69899b474471501fb69ea08e835cbf7..74e5aad7ba18cc0e9fe37b54e1fb25df19ec405d 100644 (file)
@@ -64,7 +64,7 @@ if(isset($_POST['submitForm'])) {
                                        $TemplateData['refresh'] = 'index.php?p=manageusers';
                                }
                                else {
-                                       $TemplateData['message']['content'] = "User could not be deleted. Make sure the user is not used anymore.";
+                                       $TemplateData['message']['content'] = $I18n->t('manageuser.message.couldNotBeDelete');
                                        $TemplateData['message']['status'] = "error";
                                }
                        }
@@ -82,12 +82,12 @@ if(isset($_POST['submitForm'])) {
                                                $TemplateData['refresh'] = 'index.php?p=manageusers';
                                        }
                                        else {
-                                               $TemplateData['message']['content'] = "User could not be updated. Either wrong input or duplicate user name";
+                                               $TemplateData['message']['content'] = $I18n->t('manageuser.message.couldNotBeUpdated');
                                                $TemplateData['message']['status'] = "error";
                                        }
                                }
                                else {
-                                       $TemplateData['message']['content'] = "Provide username, login and a valid user group.";
+                                       $TemplateData['message']['content'] = $I18n->t('manageuser.message.missingInput');
                                        $TemplateData['message']['status'] = "error";
                                }
                        }
@@ -104,12 +104,12 @@ if(isset($_POST['submitForm'])) {
                                                $TemplateData['refresh'] = 'index.php?p=manageusers';
                                        }
                                        else {
-                                               $TemplateData['message']['content'] = "User could not be created.";
+                                               $TemplateData['message']['content'] = $I18n->t('manageuser.message.couldNotBeCreated');
                                                $TemplateData['message']['status'] = "error";
                                        }
                                }
                                else {
-                                       $TemplateData['message']['content'] = "Provide username, login, password and a valid user group.";
+                                       $TemplateData['message']['content'] = $I18n->t('manageuser.message.missingInput');
                                        $TemplateData['message']['status'] = "error";
                                }
                        }
index 5180d2c00e3df0841286c56122f1e653062ae4bf..27a891400d00457d5a05a5999c8d5df0a04dff87 100644 (file)
@@ -39,13 +39,13 @@ if(!empty($TemplateData['editData'])) {
                        if ($do === true) {
                                $TemplateData['refresh'] = 'index.php?p=profile';
                        } else {
-                               $TemplateData['message']['content'] = "Your profile could not be updated.";
+                               $TemplateData['message']['content'] = $I18n->t('profile.message.couldNotBeUpdated');
                                $TemplateData['message']['status'] = "error";
                        }
                }
        }
 }
 else {
-       $TemplateData['message']['content'] = "Something went wrong. See logs for more details.";
+       $TemplateData['message']['content'] = $I18n->t('global.message.somethingWentWrong');
        $TemplateData['message']['status'] = "error";
 }
index cf2ecd2253a532b75af419f716f8b6710ce4394c..fa2126a93f5b6f89af4bd93d0aa2fd5ac18f5ef0 100644 (file)
@@ -2,7 +2,7 @@
 /**
  * Bibliotheca
  *
- * Copyright 2018-2023 Johannes Keßler
+ * Copyright 2018-2024 Johannes Keßler
  *
  * This program is free software: you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
index 0725b6c6c6a945e03c5447b06975182d6fcc0658..a5579b6bc693803331e56855b5b19226373f8cf4 100644 (file)
@@ -64,7 +64,7 @@ if(!empty($_collection)) {
                $TemplateData['pageTitle'] = $Trite->param('name');
        }
        else {
-               $TemplateData['message']['content'] = "Can not load given collection.";
+               $TemplateData['message']['content'] = $I18n->t('global.message.couldNotLoadCollection');
                $TemplateData['message']['status'] = "error";
        }
 }
index f0709c069776dced7e8d78224f89aa7c7e5a7389..f358261414e3b3df953f486f82efde6c5546d9c6 100644 (file)
@@ -61,12 +61,12 @@ if(isset($_POST['submitFormSearch'])) {
                                $TemplateData['bookData'] = $booksearch;
                                $TemplateData['showMatchingForm'] = true;
                        } else {
-                               $TemplateData['message']['content'] = "Nothing found.";
+                               $TemplateData['message']['content'] = $I18n->t('global.message.nothingFound');
                                $TemplateData['message']['status'] = "error";
                        }
                }
                else {
-                       $TemplateData['message']['content'] = "Invalid search term";
+                       $TemplateData['message']['content'] = $I18n->t('global.message.invalidSearchTerm');
                        $TemplateData['message']['status'] = "error";
                }
        }
@@ -118,7 +118,7 @@ if(isset($_POST['submitFormSave'])) {
                                $_r['rights'],
                                $TemplateData['editEntry']['id']
                        );
-                       $TemplateData['message']['content'] = "Date saved successfully";
+                       $TemplateData['message']['content'] = $I18n->t('global.message.dataSaved');
                }
                else {
                        // create into loaded collection
@@ -127,15 +127,14 @@ if(isset($_POST['submitFormSave'])) {
                                $_r['group'],
                                $_r['rights']
                        );
-                       $TemplateData['message']['content'] = "Date saved successfully: 
-                                               <a href='index.php?p=manageentry&collection=".$collection['id']."&id=".$do."'>Here</a>";
+                       $TemplateData['message']['content'] = $I18n->t('global.message.dataSaved')." <a href='index.php?p=manageentry&collection=".$collection['id']."&id=".$do."'>".$I18n->t('global.message.here')."</a>";
                }
 
                if(!empty($do)) {
                        $TemplateData['message']['status'] = "success";
                }
                else {
-                       $TemplateData['message']['content'] = "Data could not be saved. See logs for more.";
+                       $TemplateData['message']['content'] = $I18n->t('global.message.couldNotBeSaved');
                        $TemplateData['message']['status'] = "error";
                }
 
index 36038df13452896cff9d8769ce2271941d7939f2..5b407453813a9dea62ceeea8c28b0bc8ae409a2a 100644 (file)
@@ -71,12 +71,12 @@ if(isset($_POST['submitFormSearch'])) {
                                $TemplateData['movieImdbId'] = "tt".$IMDB->iId; // this is the IMDB id you can search for
                                $TemplateData['showMatchingForm'] = true;
                        } else {
-                               $TemplateData['message']['content'] = "Nothing found.";
+                               $TemplateData['message']['content'] = $I18n->t('global.message.nothingFound');
                                $TemplateData['message']['status'] = "error";
                        }
                }
                else {
-                       $TemplateData['message']['content'] = "Invalid search term";
+                       $TemplateData['message']['content'] = $I18n->t('global.message.invalidSearchTerm');
                        $TemplateData['message']['status'] = "error";
                }
        }
@@ -128,7 +128,7 @@ if(isset($_POST['submitFormSave'])) {
                                                $_r['rights'],
                                                $TemplateData['editEntry']['id']
                                        );
-                                       $TemplateData['message']['content'] = "Date saved successfully";
+                                       $TemplateData['message']['content'] = $I18n->t('global.message.dataSaved');
                                }
                                else {
                                        // create into loaded collection
@@ -137,19 +137,18 @@ if(isset($_POST['submitFormSave'])) {
                                                $_r['group'],
                                                $_r['rights']
                                        );
-                                       $TemplateData['message']['content'] = "Date saved successfully: 
-                                               <a href='index.php?p=manageentry&collection=".$collection['id']."&id=".$do."'>Here</a>";
+                                       $TemplateData['message']['content'] = $I18n->t('global.message.dataSaved')." <a href='index.php?p=manageentry&collection=".$collection['id']."&id=".$do."'>".$I18n->t('global.message.here')."</a>";
                                }
 
                                if(!empty($do)) {
                                        $TemplateData['message']['status'] = "success";
                                }
                                else {
-                                       $TemplateData['message']['content'] = "Data could not be saved. See logs for more.";
+                                       $TemplateData['message']['content'] = $I18n->t('global.message.couldNotBeSaved');
                                        $TemplateData['message']['status'] = "error";
                                }
                        } else {
-                               $TemplateData['message']['content'] = "Nothing found.";
+                               $TemplateData['message']['content'] = $I18n->t('global.message.nothingFound');
                                $TemplateData['message']['status'] = "error";
                        }
                }
index 2234dc0c2dee7c9d4137c3cf5202ed16ddbc67f5..10d99b25062cb2b4b3ce13a0b5d96995c86439e3 100644 (file)
@@ -67,12 +67,12 @@ if(isset($_POST['submitFormSearch'])) {
                        if(!empty($releaseSearch)) {
                                $TemplateData['releases'] = $releaseSearch;
                        } else {
-                               $TemplateData['message']['content'] = "Nothing found.";
+                               $TemplateData['message']['content'] = $I18n->t('global.message.nothingFound');
                                $TemplateData['message']['status'] = "error";
                        }
                }
                else {
-                       $TemplateData['message']['content'] = "Invalid search term";
+                       $TemplateData['message']['content'] = $I18n->t('global.message.invalidSearchTerm');
                        $TemplateData['message']['status'] = "error";
                }
        }
@@ -88,7 +88,7 @@ if(isset($_POST['submitFormReleaseSelect'])) {
                                if(!empty($releaseInfo)) {
                                        $TemplateData['release'] = $releaseInfo;
                                } else {
-                                       $TemplateData['message']['content'] = "Nothing found.";
+                                       $TemplateData['message']['content'] = $I18n->t('global.message.nothingFound');
                                        $TemplateData['message']['status'] = "error";
                                }
                        }
@@ -147,7 +147,7 @@ if(isset($_POST['submitFormSave'])) {
                                $_r['rights'],
                                $TemplateData['editEntry']['id']
                        );
-                       $TemplateData['message']['content'] = "Date saved successfully";
+                       $TemplateData['message']['content'] = $I18n->t('global.message.dataSaved');
                }
                else {
                        // create into loaded collection
@@ -156,15 +156,14 @@ if(isset($_POST['submitFormSave'])) {
                                $_r['group'],
                                $_r['rights']
                        );
-                       $TemplateData['message']['content'] = "Date saved successfully: 
-                                               <a href='index.php?p=manageentry&collection=".$collection['id']."&id=".$do."'>Here</a>";
+                       $TemplateData['message']['content'] = $I18n->t('global.message.dataSaved')." <a href='index.php?p=manageentry&collection=".$collection['id']."&id=".$do."'>".$I18n->t('global.message.here')."</a>";
                }
 
                if(!empty($do)) {
                        $TemplateData['message']['status'] = "success";
                }
                else {
-                       $TemplateData['message']['content'] = "Data could not be saved. See logs for more.";
+                       $TemplateData['message']['content'] = $I18n->t('global.message.couldNotBeSaved');
                        $TemplateData['message']['status'] = "error";
                }
 
index d77edf12120881f34dea663886d159e96ed65830..995ddd71dd5b9567b65af8efcffdc8aadaf2f26f 100644 (file)
@@ -76,12 +76,12 @@ if(!empty($_collection) && !empty($_t)) {
                }
                else {
                        $TemplateData['tool']['viewFile'] = '';
-                       $TemplateData['message']['content'] = "Required tool files can not be found.";
+                       $TemplateData['message']['content'] = $I18n->t('tool.message.missingFiles');
                        $TemplateData['message']['status'] = "error";
                }
        }
        else {
-               $TemplateData['message']['content'] = "Collection nor tool could not be loaded.";
+               $TemplateData['message']['content'] = $I18n->t('global.message.couldNotLoadCollection');
                $TemplateData['message']['status'] = "error";
        }
 }