Malkum has uploaded a new change for review.
https://gerrit.wikimedia.org/r/52047
Change subject: (bug 45493) [TUX] Do not consider empty string to mark a
translation as "unsaved"
......................................................................
(bug 45493) [TUX] Do not consider empty string to mark a translation as
"unsaved"
Change-Id: I59b5b4d1811cf435c72d7796eff6fa6222fb77e1
---
M resources/js/ext.translate.editor.js
1 file changed, 12 insertions(+), 0 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Translate
refs/changes/47/52047/1
diff --git a/resources/js/ext.translate.editor.js
b/resources/js/ext.translate.editor.js
index 75ae71e..43d390a 100644
--- a/resources/js/ext.translate.editor.js
+++ b/resources/js/ext.translate.editor.js
@@ -334,6 +334,18 @@
$saveButton =
translateEditor.$editor.find( '.tux-editor-save-button' ),
$pasteSourceButton =
translateEditor.$editor.find( '.tux-editor-paste-original-button' );
+ // Avoid untranslate marking when translated
message
+ // is not changed in content length.
Untranslated message
+ // contains null so making it empty for length
check.
+ var translationMessage =
translateEditor.message.translation;
+ if( translationMessage == null) {
+ translationMessage = '';
+ }
+ if( translationMessage.length ==
$textArea.val().length ) {
+ translateEditor.dirty = false;
+ }
+
+
$saveButton.text( mw.msg(
'tux-editor-save-button-label' ) );
// When there is content in the editor
if ( $.trim( $textArea.val() ) ) {
--
To view, visit https://gerrit.wikimedia.org/r/52047
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I59b5b4d1811cf435c72d7796eff6fa6222fb77e1
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Translate
Gerrit-Branch: master
Gerrit-Owner: Malkum <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits