managecol.input.defaultsearchfield = "Default global search field"
managecol.input.defaultsort = "Default sort field"
managecol.input.defaultsortorder = "Default sort order"
-managecol.input.delete = global.delete
+managecol.input.delete = reuse.global.delete
managecol.input.delete.howto = "Warning: This will delete ALL the data in this collection!"
-managecol.input.description = global.description
-managecol.input.name = global.name
+managecol.input.description = reuse.global.description
+managecol.input.name = reuse.global.name
managecol.input.name.placeholder = "Unique name. No special chars."
managecol.input.overwriterights = "Overwrite existing rights"
managecol.input.overwriterights.howto = "Warning: This will overwrite existing entry rights (user, group, rights) with the ones from the collection!"
manageentry.message.viewNewEntry = "View your new entry"
manageentry.possibleduplicate = "Possible duplicate"
manageentry.select.bulkedit = "Select bulk edit option"
-manageentry.select.bulkedit.add = global.add
-manageentry.select.bulkedit.clear = global.clear
-manageentry.select.bulkedit.replace = global.replace
+manageentry.select.bulkedit.add = reuse.global.add
+manageentry.select.bulkedit.clear = reuse.global.clear
+manageentry.select.bulkedit.replace = reuse.global.replace
manageentry.updateentry = "Update an entry in:"
manageentry.viewentry = "View entry"
managegroups.addormodify = "Add or modify a group"
managegroups.availablegroups = "Available groups"
managegroups.groupmanagement = "Group management"
-managegroups.input.delete = global.delete
+managegroups.input.delete = reuse.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.save = global.save
+managegroups.input.description = reuse.global.description
+managegroups.input.name = reuse.global.name
+managegroups.input.save = reuse.global.save
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.delete = reuse.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."
manageuser.addormodify = "Add or modify a user"
manageuser.availableusers = "Available users"
-manageuser.created = global.created
+manageuser.created = reuse.global.created
manageuser.groups = "Group(s)"
manageuser.input.addgroups = "Additional groups"
manageuser.input.apitoken = "Create API Token"
manageuser.input.apitoken.current = "Current Token:"
manageuser.input.apitoken.valid = "Valid until:"
manageuser.input.canloging = "Can login"
-manageuser.input.delete = global.delete
+manageuser.input.delete = reuse.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."
message.headline.warning = "Warning"
menu.manage = "Manage"
-menu.manage.add = global.add
-menu.manage.collections = global.collections
+menu.manage.add = reuse.global.add
+menu.manage.collections = reuse.global.collections
menu.manage.groups = "Groups"
menu.manage.profile = "Profile"
-menu.manage.tags = global.tags
+menu.manage.tags = reuse.global.tags
menu.manage.users = "Users"
-menu.search = global.search
+menu.search = reuse.global.search
menu.search.advanced = "Advanced"
menu.search.enter = "Press enter to search"
menu.search.within = "Search within the default search field"
menu.show = "Show"
-menu.show.collections = global.collections
+menu.show.collections = reuse.global.collections
menu.show.dashboard = "Dashboard"
menu.show.sysinfo = "System Information"
-menu.show.tags = global.tags
+menu.show.tags = reuse.global.tags
pagination.gotopage = "Goto page"
pagination.next = "next"
pagination.select.sort.latest = "Latest"
profile.input.addgroups = "Additional groups"
-profile.input.apitoken.current = manageuser.input.apitoken.current
-profile.input.apitoken.valid = manageuser.input.apitoken.valid
+profile.input.apitoken.current = reuse.manageuser.input.apitoken.current
+profile.input.apitoken.valid = reuse.manageuser.input.apitoken.valid
profile.input.createtoken = "Create API Token"
profile.input.maingroup = "Main group"
profile.message.couldNotBeUpdated = "Your profile could not be updated."
sysinfo.headline.sysinfo = "System information"
sysinfo.th.collection = "Collection"
-sysinfo.th.created = global.created
+sysinfo.th.created = reuse.global.created
sysinfo.th.dbusage = "DB Usage"
-sysinfo.th.description = global.description
+sysinfo.th.description = reuse.global.description
sysinfo.th.diskusage = "Disk Usage"
sysinfo.th.entries = "Entries"
-sysinfo.th.tags = global.tags
+sysinfo.th.tags = reuse.global.tags
sysfield.actors = "Actors"
sysfield.artist = "Artist"
tags.headline.tagsfor = "Tags for:"
+tool.gameinfo = "This is a collection of websites which provide different kind of information about games."
+tool.googlebooks.save = reuse.global.save
+tool.googlebooks.search = reuse.global.search
+tool.googlebooks.searchIsbn = "Search ISBN"
+tool.googlebooks.select = reuse.global.none
tool.headline.using = "Using %s with collection: %s"
+tool.imdb.save = reuse.global.save
+tool.imdb.search = reuse.global.search
+tool.imdb.select.none = reuse.global.none
+tool.limitations = "Limitations"
+tool.limitations.override = "Data will be overwritten"
tool.message.missingFiles = "Required tool files can not be found."
+tool.music.input.albumTitle = "Album/Title"
+tool.music.input.artist = "Artist"
+tool.music.limitations.override = "Data will be overwritten; No wildcardsearch or partial words."
+tool.music.save = reuse.global.save
+tool.music.search = reuse.global.search
+tool.music.select = "Select"
+tool.music.select.none = reuse.global.none
*/
private array $_langData = array();
+ /**
+ * @var array The fallback lang data.
+ */
+ private array $_langDataFallback = array();
+
/**
* Translation constructor.
*/
public function __construct() {
+ // load fallback
+ $this->_langDataFallback = parse_ini_file(PATH_ABSOLUTE.'/i18n/eng.ini');
+ if(!$this->_langDataFallback) {
+ Summoner::sysLog('[ERROR] Missing fallback language file!');
+ }
+
if(defined('FRONTEND_LANGUAGE')) {
$this->_iso3 = FRONTEND_LANGUAGE['iso3'];
$this->_iso2 = FRONTEND_LANGUAGE['iso2'];
}
}
else {
- $_langFile = PATH_ABSOLUTE.'/i18n/'.$this->_iso3.'.ini';
- $_langData = parse_ini_file($_langFile);
- if($_langData !== false) {
- $this->_langData = $_langData;
- }
+ $this->_langData = $this->_langDataFallback;
}
}
*/
public function t(string $key, mixed $replace=''): string {
$ret = $key;
+ $_langWorkWith = $this->_langData;
if(isset($this->_langData[$key])) {
$ret = $this->_langData[$key];
- // the value is another key
- if(!str_contains($ret, '"') && str_contains($ret, ".") && isset($this->_langData[$ret])) {
- $ret = $this->_langData[$ret];
+ } elseif(!DEBUG && isset($this->_langDataFallback[$key])) {
+ $ret = $this->_langDataFallback[$key];
+ $_langWorkWith = $this->_langDataFallback;
+ }
+
+ // the value is another key
+ if(str_starts_with($ret, "reuse.")) {
+ $_ret = str_replace("reuse.","",$ret);
+ if(isset($_langWorkWith[$_ret])) {
+ $ret = $_langWorkWith[$_ret];
}
+ }
- if(!empty($replace)) {
- if(is_array($replace)) {
- $ret = vsprintf($ret, $replace);
- } else {
- $ret = sprintf($ret, $replace);
- }
+ if(!empty($replace)) {
+ if(is_array($replace)) {
+ $ret = vsprintf($ret, $replace);
+ } else {
+ $ret = sprintf($ret, $replace);
}
}
return $ret;
-<p><b>Limitations</b></p>
-<p>Data will be overwritten; No wildcardsearch or partial words.</p>
+<p><b><?php echo $I18n->t('tool.lomitations'); ?></b></p>
+<p><?php echo $I18n->t('tool.music.limitations.override'); ?></p>
<form class="uk-form-horizontal uk-margin-small" method="post" enctype="multipart/form-data">
<div class="uk-margin">
- <label class="uk-form-label" for="artist">Artist</label>
+ <label class="uk-form-label" for="artist"><?php echo $I18n->t('tool.music.input.artist'); ?></label>
<div class="uk-form-controls">
<input class="uk-input" id="artist" type="text" autocomplete="off"
name="fdata[artist]"
</div>
</div>
<div class="uk-margin">
- <label class="uk-form-label" for="album">Album/Title</label>
+ <label class="uk-form-label" for="album"><?php echo $I18n->t('tool.music.input.albumTitle'); ?></label>
<div class="uk-form-controls">
<input class="uk-input" id="album" type="text" autocomplete="off"
name="fdata[album]"
</div>
<div class="uk-margin">
<button class="uk-button uk-button-primary" type="submit" name="submitFormSearch">
- Search
+ <?php echo $I18n->t('tool.music.search'); ?>
</button>
</div>
</form>
<form class="uk-form-horizontal uk-margin-small" method="post" enctype="multipart/form-data">
<div class="uk-margin">
<div class="uk-form-controls">
-
<?php foreach($TemplateData['releases'] as $k=>$v) { ?>
<label><input class="uk-radio" type="radio" name="fdata[rselect]" value="<?php echo $k; ?>"> <?php echo $v; ?></label><br>
<div class="uk-margin">
<button class="uk-button uk-button-primary" type="submit" name="submitFormReleaseSelect">
- Select
+ <?php echo $I18n->t('tool.music.select'); ?>
</button>
</div>
</form>
</div>
<div class="uk-width-1-2@s">
<select class="uk-select" name="fdata[into][<?php echo $k; ?>]">
- <option value="">None</option>
+ <option value=""><?php echo $I18n->t('tool.music.select.none'); ?></option>
<?php echo toolMethod_GetTargetSelection($TemplateData['saveToSelection'],$k); ?>
</select>
</div>
<div class="uk-margin">
<button class="uk-button uk-button-primary" type="submit" name="submitFormSave">
- Save
+ <?php echo $I18n->t('tool.music.save'); ?>
</button>
</div>
</form>