Skip to content

Commit

Permalink
Merge pull request #427 from haraldpdl/lang_keyword_update
Browse files Browse the repository at this point in the history
use {{keyword}} instead of :keyword for language definitions
  • Loading branch information
haraldpdl committed Oct 27, 2016
2 parents a9f1b54 + 8c859ee commit 4192ace
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion catalog/admin/includes/languages/english/server_info.txt
Expand Up @@ -16,7 +16,7 @@ title_database = Database:
title_database_date = Database Date:
title_database_name = Database Name:

text_export_intro = The following information can be submitted to osCommerce by clicking on the <span class="label label-default">:button_submit_to_oscommerce</span> button. You can also save the information to a file by clicking <span class="label label-default">:button_save</span>. This information is completely anonymous, cannot be used to identify an individual system, and is used for support and development purposes only.
text_export_intro = The following information can be submitted to osCommerce by clicking on the <span class="label label-default">{{button_submit_to_oscommerce}}</span> button. You can also save the information to a file by clicking <span class="label label-default">{{button_save}}</span>. This information is completely anonymous, cannot be used to identify an individual system, and is used for support and development purposes only.

success_info_submit = Your server information has been submitted sucessfully to the osCommerce website. Thanks!
error_info_submit = Could not connect to the osCommerce website to submit your server information. Please try again later.
4 changes: 2 additions & 2 deletions catalog/admin/server_info.php
Expand Up @@ -81,8 +81,8 @@
<p>
<?=
OSCOM::getDef('text_export_intro', [
':button_submit_to_oscommerce' => OSCOM::getDef('button_submit_to_oscommerce'),
':button_save' => IMAGE_SAVE
'button_submit_to_oscommerce' => OSCOM::getDef('button_submit_to_oscommerce'),
'button_save' => IMAGE_SAVE
]);
?>
</p>
Expand Down
4 changes: 3 additions & 1 deletion catalog/includes/OSC/OM/Language.php
Expand Up @@ -172,7 +172,9 @@ public function getDef($key, $values = null, $scope = 'global')
$def = $this->definitions[$scope][$key];

if (is_array($values) && !empty($values)) {
$def = str_replace(array_keys($values), array_values($values), $def);
$def = preg_replace_callback('/\{\{([A-Za-z0-9-_]+)\}\}/', function($matches) use ($values) {
return isset($values[$matches[1]]) ? $values[$matches[1]] : $matches[1];
}, $def);
}

return $def;
Expand Down

0 comments on commit 4192ace

Please sign in to comment.