diff --git a/component/admin/models/fields/keystatus.php b/component/admin/models/fields/keystatus.php new file mode 100644 index 00000000..63199e1b --- /dev/null +++ b/component/admin/models/fields/keystatus.php @@ -0,0 +1,71 @@ +element['onchange']) + { + $attributes .= ' onchange="' . $v . '"'; + } + + $attributes .= ' class="filter-select"'; + $options = array(); + + foreach ($this->element->children() as $option) + { + $options[] = JHtml::_('select.option', '', JText::_(trim($option)), + array('option.attr' => 'attributes', 'attr' => 'class="filter-select"') + ); + } + + $options[] = JHtml::_('select.option', 'allkeys', JText::_('JALL'), + array('option.attr' => 'attributes', 'attr' => 'class="allkeys"') + ); + + $options[] = JHtml::_('select.option', 'translatedkeys', JText::_('COM_LOCALISE_TEXT_TRANSLATION_TRANSLATED'), + array('option.attr' => 'attributes', 'attr' => 'class="translated"') + ); + $options[] = JHtml::_('select.option', 'untranslatedkeys', JText::_('COM_LOCALISE_TEXT_TRANSLATION_UNTRANSLATED'), + array('option.attr' => 'attributes', 'attr' => 'class="untranslated"') + ); + $options[] = JHtml::_('select.option', 'unchangedkeys', JText::_('COM_LOCALISE_TEXT_TRANSLATION_UNCHANGED'), + array('option.attr' => 'attributes', 'attr' => 'class="unchanged"') + ); + + return $options; + } +} diff --git a/component/admin/models/forms/translation.xml b/component/admin/models/forms/translation.xml index 10f9bc84..65ce7225 100644 --- a/component/admin/models/forms/translation.xml +++ b/component/admin/models/forms/translation.xml @@ -74,6 +74,20 @@ name="svn" type="hidden" /> + +
+ +
+
getState('translation.path') : $this->getState('translation.refpath'); + $this->setState('translation.translatedkeys', array()); + $this->setState('translation.untranslatedkeys', array()); + $this->setState('translation.unchangedkeys', array()); + + $translatedkeys = $this->getState('translation.translatedkeys'); + $untranslatedkeys = $this->getState('translation.untranslatedkeys'); + $unchangedkeys = $this->getState('translation.unchangedkeys'); + $this->item = new JObject( array ( @@ -183,6 +193,9 @@ public function getItem($pk = null) 'additionalcopyright' => array(), 'license' => '', 'exists' => JFile::exists($this->getState('translation.path')), + 'translatedkeys' => (array) $translatedkeys, + 'untranslatedkeys' => (array) $untranslatedkeys, + 'unchangedkeys' => (array) $unchangedkeys, 'translated' => 0, 'unchanged' => 0, 'extra' => 0, @@ -401,18 +414,36 @@ public function getItem($pk = null) if (!empty($sections['keys']) && array_key_exists($key, $sections['keys']) && $sections['keys'][$key] != '') { - if ($sections['keys'][$key] != $string || $this->getState('translation.path') == $this->getState('translation.refpath')) + if ($sections['keys'][$key] != $string) + { + $this->item->translated++; + $translatedkeys[] = $key; + } + elseif ($this->getState('translation.path') == $this->getState('translation.refpath')) { $this->item->translated++; } else { $this->item->unchanged++; + $unchangedkeys[] = $key; } } + elseif (!array_key_exists($key, $sections['keys'])) + { + $untranslatedkeys[] = $key; + } } } + $this->item->translatedkeys = $translatedkeys; + $this->item->untranslatedkeys = $untranslatedkeys; + $this->item->unchangedkeys = $unchangedkeys; + + $this->setState('translation.translatedkeys', $translatedkeys); + $this->setState('translation.untranslatedkeys', $untranslatedkeys); + $this->setState('translation.unchangedkeys', $unchangedkeys); + if (!empty($sections['keys'])) { foreach ($sections['keys'] as $key => $string) diff --git a/component/admin/views/translation/tmpl/edit.php b/component/admin/views/translation/tmpl/edit.php index a9cd6776..9b19512d 100644 --- a/component/admin/views/translation/tmpl/edit.php +++ b/component/admin/views/translation/tmpl/edit.php @@ -17,6 +17,41 @@ $parts = explode('-', $this->state->get('translation.tag')); $dest = $parts[0]; +// No use to filter if target language is also reference language +if ($this->state->get('translation.reference') != $this->state->get('translation.tag')) +{ + $istranslation = 1; +} +else +{ + $istranslation = 0; +} + +$input = JFactory::getApplication()->input; +$posted = $input->post->get('jform', array(), 'array'); + +if (isset($posted['select']['keystatus']) + && !empty($posted['select']['keystatus']) + && $posted['select']['keystatus'] != 'allkeys' + ) +{ + $filter = $posted['select']['keystatus']; + $keystofilter = array ($this->item->$filter); + $tabchoised = 'strings'; +} +elseif (empty($posted['select']['keystatus'])) +{ + $filter = 'allkeys'; + $keystofilter = array(); + $tabchoised = 'default'; +} +else +{ + $filter = 'allkeys'; + $keystofilter = array(); + $tabchoised = 'default'; +} + $document = JFactory::getDocument(); $document->addScriptDeclaration(" if (typeof(Localise) === 'undefined') { @@ -102,69 +137,84 @@ function translateAll()
- $this->ftp ? 'ftp' : 'default')); ?> + $this->ftp ? 'ftp' : $tabchoised)); ?> ftp) : ?> - label, true)); ?> - description)):?> -

description); ?>

- - ftp)): ?> -

ftp->message); ?>

- - formftp->getFieldset('ftp',false) as $field): ?> -
-
- label; ?> -
-
- input; ?> -
-
- - + label, true)); ?> + description)):?> +

description); ?>

+ + ftp)): ?> +

ftp->message); ?>

+ + formftp->getFieldset('ftp',false) as $field) : ?> +
+
+ label; ?> +
+
+ input; ?> +
+
+ + label, true)); ?> - description)):?> -

description); ?>

+ description)) : ?> +

description); ?>

- form->getFieldset('default') as $field): ?> -
-
- label; ?> -
-
- input; ?> + form->getFieldset('default') as $field) : ?> +
+
+ label; ?> +
+
+ input; ?> +
-
-
-
-
- -
-
- description)):?> +
+
+ +
+
+ description)) : ?>

description); ?>

- -
    - form->getFieldset('legend') as $field): ?> -
  • - label; ?> - input; ?> -
  • - -
-
+ +
    + form->getFieldset('legend') as $field) : ?> +
  • + label; ?> + input; ?> +
  • + +
+
+
+ +
+ form->getFieldset('select') as $field): ?> + type != "Spacer") : ?> + value = $filter; + echo JText::_('JSEARCH_FILTER_LABEL'); + echo $field->input; + ?> + + label; ?> + + +
+ @@ -181,41 +231,131 @@ function translateAll() echo JHtml::_('bootstrap.addSlide', 'localise-translation-sliders', JText::_($fieldSet->label), 'collapse' . $i++); ?>
    - form->getFieldset($name) as $field) :?> -
  • - label; ?> - input; ?> -
  • - + form->getFieldset($name) as $field) : ?> + $ids) + { + foreach ($ids as $keytofilter) + { + $showkey = 0; + $pregkey = preg_quote(''. $keytofilter .'', '/<>'); + + if (preg_match("/$pregkey/", $field->label)) + { + $showkey = 1; + break; + } + } + } + + if ($showkey == '1') + { + ?> +
  • + label; ?> + input; ?> +
  • + +
    + label; ?> + input; ?> +
    + +
  • + label; ?> + input; ?> +
  • + +
-
    +
      form->getFieldset($sections[0]) as $field) :?> -
    • - label; ?> - input; ?> -
    • - -
    + $ids) + { + foreach ($ids as $keytofilter) + { + $showkey = 0; + $pregkey = preg_quote(''.$keytofilter.'', '/<>'); + + if (preg_match("/$pregkey/", $field->label)) + { + $showkey = 1; + break; + } + } + } + + if ($showkey == '1') + { + ?> +
  • + label; ?> + input; ?> +
  • + +
    + label; ?> + input; ?> +
    + +
  • + label; ?> + input; ?> +
  • + + +
label, true)); ?> description)):?> -

description); ?>

+

description); ?>

form->getFieldset('permissions') as $field) : ?> -
-
- input; ?> +
+
+ input; ?> +
-