Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions component/admin/language/en-GB/en-GB.com_localise.ini
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ COM_LOCALISE_CANNOT_REMOVE_DEFAULT_LANGUAGE="Localise cannot remove default lang

COM_LOCALISE_ACCESS_TRANSLATION_EDIT="Translate"
COM_LOCALISE_ACCESS_TRANSLATION_EDIT_DESC="Translate description"
COM_LOCALISE_CONFIRM_TRANSLATION_SAVE="Before saving, make sure you have set if the translation is 'Complete' or not in the 'Details' tab."
COM_LOCALISE_ERROR_TRANSLATION_FILESAVE="Error saving translation file %s"
COM_LOCALISE_FIELDSET_TRANSLATION_DETAIL="Details"
COM_LOCALISE_FIELDSET_TRANSLATION_DETAIL_DESC="Values ​​of inactive fields are set in general settings of Localise component."
Expand Down Expand Up @@ -195,6 +196,8 @@ COM_LOCALISE_LABEL_TRANSLATION_SOURCE="File Source"
COM_LOCALISE_LABEL_TRANSLATION_SOURCE_DESC="Press Ctrl-Q to toggle Full Screen editing."
COM_LOCALISE_LABEL_TRANSLATION_VERSION="Version"
COM_LOCALISE_LABEL_TRANSLATION_VERSION_DESC=""
COM_LOCALISE_NOTICE_TRANSLATION_COMPLETE="The translation file has been saved as 'Complete'."
COM_LOCALISE_NOTICE_TRANSLATION_NOT_COMPLETE="The translation file has not been saved as 'Complete'."
COM_LOCALISE_TEXT_TRANSLATION_EDITOR="%1$s (%2$s)"
COM_LOCALISE_TEXT_TRANSLATION_NOTINREFERENCE="Not in reference"
COM_LOCALISE_TEXT_TRANSLATION_TRANSLATED="Translated"
Expand Down
2 changes: 1 addition & 1 deletion component/admin/language/en-GB/en-GB.com_localise.sys.ini
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ COM_LOCALISE_ERROR_INSTALL_JVERSION="The Localise component requires version %s
COM_LOCALISE_LANGUAGES="Languages"
COM_LOCALISE_TRANSLATIONS="Translations"
COM_LOCALISE_PACKAGES="Packages"
COM_LOCALISE_XML_DESCRIPTION="<h2>Successfully installed Localise component</h2>Nice and easy management of languages and translation files.<br/><ul style='text-align:justify'><li>Site, Administrator, Installation Languages</li><li>Create, Edit, Delete Languages</li><li>Create, Edit, Delete, Publish, Unpublish, Checkin, Checkout Translation Files</li><li>Show Translation Progress for each file and language</li><li>Automatically create missing Translation Files</li><li>Create Language Installation Archives</li></ul><p>This component works on the language translation files of your Joomla installation - it will not work without reading, writing and renaming rights on the language directories and files.</p><p><b>YOU SHOULD MAKE A BACKUP OF YOUR LANGUAGE FILES</b></p>"
COM_LOCALISE_XML_DESCRIPTION="<h2>Successfully installed Localise component</h2>Nice and easy management of languages and translation files.<br/><ul style='text-align:justify'><li>Site, Administrator, Installation Languages</li><li>Create, Edit, Delete Languages</li><li>Create, Edit, Delete, Publish, Unpublish, Checkin, Checkout Translation Files</li><li>Show Translation Progress for each file and language</li><li>Automatically create missing Translation Files</li><li>Create Language Installation Archives</li><li><strong>NEW since 4.0.15-dev</strong>: the component may now not only take care of new strings, but also the changed values of existing strings!</li></ul><p>This component works on the language translation files of your Joomla installation - it will not work without reading, writing and renaming rights on the language directories and files.</p><p><strong>YOU SHOULD MAKE A BACKUP OF YOUR LANGUAGE FILES</strong></p>"
COM_LOCALISE_LABEL_LANGUAGE_EMAIL="Author Email"
COM_LOCALISE_LABEL_LANGUAGE_URL="Author URL"
11 changes: 8 additions & 3 deletions component/admin/models/forms/translation.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,16 @@
description="COM_LOCALISE_LABEL_TRANSLATION_LICENSE_DESC" />
<field
name="complete"
type="checkbox"
value="1"
type="radio"
class="btn-group btn-group-yesno"
default="0"
label="COM_LOCALISE_LABEL_TRANSLATION_COMPLETE"
description="COM_LOCALISE_LABEL_TRANSLATION_COMPLETE_DESC" />
description="COM_LOCALISE_LABEL_TRANSLATION_COMPLETE_DESC">
<option
value="1">JYES</option>
<option
value="0">JNO</option>
</field>
<field
name="asset_id"
type="hidden"
Expand Down
14 changes: 14 additions & 0 deletions component/admin/models/translation.php
Original file line number Diff line number Diff line change
Expand Up @@ -1259,8 +1259,13 @@ public function saveFile($data)

if (array_key_exists('complete', $data) && ($data['complete'] == '1'))
{
$this->setState('translation.complete', 1);
$contents2 .= "; @note Complete\n";
}
else
{
$this->setState('translation.complete', 0);
}

$contents2 .= "; @note Client " . ucfirst($client) . "\n";
$contents2 .= "; @note All ini files need to be saved as UTF-8\n\n";
Expand Down Expand Up @@ -1541,6 +1546,15 @@ public function save($data)
return false;
}

if ($this->getState('translation.complete') == 1)
{
JFactory::getApplication()->enqueueMessage(JText::_('COM_LOCALISE_NOTICE_TRANSLATION_COMPLETE'), 'notice');
}
else
{
JFactory::getApplication()->enqueueMessage(JText::_('COM_LOCALISE_NOTICE_TRANSLATION_NOT_COMPLETE'), 'notice');
}

return true;
}
}
10 changes: 9 additions & 1 deletion component/admin/views/translation/tmpl/edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@

// Prepare Bing translation
JText::script('COM_LOCALISE_BINGTRANSLATING_NOW');
JText::script('COM_LOCALISE_CONFIRM_TRANSLATION_SAVE');
?>
<script type="text/javascript">
var bingTranslateComplete = false, translator;
Expand Down Expand Up @@ -152,7 +153,14 @@ function translateAll()

Joomla.submitbutton = function(task)
{
if (task == 'translation.cancel' || document.formvalidator.isValid(document.id('localise-translation-form')))
if ((task == 'translation.apply' || task == 'translation.save') && document.formvalidator.isValid(document.id('localise-translation-form')))
{
if (confirm(Joomla.JText._('COM_LOCALISE_CONFIRM_TRANSLATION_SAVE')))
{
Joomla.submitform(task, document.getElementById('localise-translation-form'));
}
}
else if (task == 'translation.cancel')
{
Joomla.submitform(task, document.getElementById('localise-translation-form'));
}
Expand Down