Rank: Advanced Member
Groups: Translators, Moderators, Approved Joined: 4/6/2020(UTC) Posts: 79 Thanks: 1 times Was thanked: 21 time(s) in 21 post(s)
|
save this👇 to a bookmark and click it after the translation page is fully loaded.
javascript:if($("#A47E94C45130")[0]==null){inject();var namee=[];var value=[]}function clear(){namee=[];value=[]}function inject(){$("div.body-content").children("div:first").after(`<div id="tools"><button onclick="conv()">input</button><button onclick="clear()">clear</button><button onclick="check()">check</button><button onclick="ps()">replace</button><br><textarea id="A47E94C45130"placeholder="(\\n for new line, \\\\n for literally '\\n')\nName,Translation OR Name,\n..."rows='3'></textarea></div>`);$("ul.nav.navbar-nav:first").append(`<div id="tools"><label for="ddfhr">for unchecked:<button onclick="hideCheck(true)">hide</button><button onclick="hideCheck(false)">show</button><button onclick="delCheck(false)">delete</button>|<button onclick="revCheck(true)">rev check</button><button onclick="checkAll(false)">check all</button><button onclick="checkAll(true)">uncheck all</button>|<button onclick="fliter(false)">filter</button><button onclick="fliter(true)">filter out</button><input type="radio"name="fliter"id="r1"place="$"find="input"value="].Name"checked="checked"><label for="r1">name</label><input type="radio"name="fliter"id="r2"place="$"find="input"value="].Comment"><label for="r2">description</label><input type="radio"name="fliter"id="r3"place="^"find="textarea"value="BaseResourceID_"><label for="r3">english</label><input type="radio"name="fliter"id="r4"place="$"find="textarea"value="].TranslatedValue"><label for="r4">translated</label><input type="radio"name="fliter"id="r5"place="$"find="textarea"value="].TranslationComment"><label for="r5">comments</label></label></div>`);$(`span.cellLabel:has('b:contains("Name")')`).prepend('<input type="checkbox">');$('div.col-md-2:not(:has("textarea"))').click(function(e){span_input_check(e.currentTarget.parentNode.firstElementChild,true)})}function hideCheck(hide){$(`:checkbox:not(:checked)`).each(function(index,item){item.parentNode.parentNode.parentNode.style.display=hide?'none':''})}function delCheck(){$(`:checkbox:not(:checked)`).each(function(index,item){item.parentNode.parentNode.parentNode.remove()})}function fliter(flitOut){var rule=prompt('input regex');var radio=$(':radio:checked')[0];var find=radio.getAttribute('find');var arr=$(`${find}[name${radio.getAttribute('place')}='${radio.value}']`);if(find=='input'){arr.each(function(index,item){if(item.value.search(rule)!=-1){span_input_check(!flitOut,item.parentNode)}})}else if(find=='textarea'){arr.each(function(index,item){if(item.value.search(rule)!=-1){span_input_check(!flitOut,item.parentNode.parentNode.firstElementChild)}})}}function span_input_check(arg1,arg2){if(arg2===true){var a=arg1.getElementsByTagName('span')[0].getElementsByTagName('input')[0];a.checked=!a.checked}else{arg2.getElementsByTagName('span')[0].getElementsByTagName('input')[0].checked=arg1}}function checkAll(uncheck){$(`:checkbox${uncheck?'':':not'}(:checked)`).each(function(index,item){item.checked=!uncheck})}function revCheck(){var c=$(`:checkbox:checked`);var u=$(`:checkbox:not(:checked)`);c.each(function(index,item){item.checked=false});u.each(function(index,item){item.checked=true})}function check(){namee.forEach(function(index,item){span_input_check(true,$(`input[name$='].Name'][value='${item}']`)[0].parentNode)})}function ps(){console.time('replace done');namee.forEach(function(item,index){var a=$(`input[name$='].Name'][value='${item}']`)[0];var b=a.name.replace('Items[','').replace('].Name','');$(`textarea[name='Items[${b}].TranslatedValue'`)[0].value=value[index];console.log(b+' , '+item+' = '+value[index])});console.timeEnd('replace done');clear()}function conv(){console.time('conv done');$("textarea#A47E94C45130")[0].value.split('\n').forEach(function(item){var dot=item.indexOf(',');var nam=item.substring(0,dot);var a=$(`input[name$='].Name'][value='${nam}']`)[0];if(a!=null){namee.push(nam);var val=item.substring(dot+1);val=val.replace(/(?<!\\)\\n/g,'\n');val=val.replace(/\\\\n/g,'\\n');value.push(val)}else{console.log(nam+' not exist')}});console.timeEnd('conv done')}//$("textarea:parent[name$='TranslationComment']").toArray().forEach(function(item,index){console.log(item.value)});
Edited by user Thursday, July 9, 2020 3:54:22 AM(UTC)
| Reason: Not specified
|
1 user thanked liuxilu for this useful post.
|
|
|
Rank: Member
Groups: Translators, Approved Joined: 6/26/2020(UTC) Posts: 10 Location: Lima Thanks: 4 times Was thanked: 1 time(s) in 1 post(s)
|
That's nice man, thanks for sharing the tools that you're using. In this case, this adds a control panel for translation (filtering, input, etc.). Question: Do you know if i can erase translation for multiple entries? Should i use these controls? Thanks again.
|
|
|
|
Rank: Advanced Member
Groups: Translators, Moderators, Approved Joined: 4/6/2020(UTC) Posts: 79 Thanks: 1 times Was thanked: 21 time(s) in 21 post(s)
|
Just type multiple lines.
|
|
|
|
Rank: Advanced Member
Groups: Translators, Moderators, Approved Joined: 4/6/2020(UTC) Posts: 79 Thanks: 1 times Was thanked: 21 time(s) in 21 post(s)
|
I'm using that textbox in this way: Download .resx and open it with Visual Studio, select all and copy, paste in EmEditor and run the following macro: Code:document.Encoding = eeEncodingUTF8 ;
document.selection.StartOfDocument();
document.selection.Replace('((?:\\t.+|")\\t).+$', '\\1', eeFindReplaceCase | eeReplaceAll | eeFindReplaceRegExp,eeExFindSeparateCRLF | eeExFindRegexOnigmo);
document.selection.Replace('\\n', '\\\\n', eeFindReplaceCase | eeReplaceAll);
do {
t = document.selection.Replace('^(.+\\t".+)(?<!"\\t)$\\r\\n', '\\1\\\\n', eeFindReplaceCase | eeReplaceAll | eeFindReplaceRegExp,eeExFindSeparateCRLF | eeExFindRegexOnigmo);
} while (t > 0)
document.selection.Replace('"?\\t$', '', eeFindReplaceCase | eeReplaceAll | eeFindReplaceRegExp,eeExFindSeparateCRLF | eeExFindRegexOnigmo);
document.selection.Replace('^(.+\\t)"', '\\1', eeFindReplaceCase | eeReplaceAll | eeFindReplaceRegExp,eeExFindSeparateCRLF | eeExFindRegexOnigmo);
document.selection.Replace('^([a-zA-Z0-9\\.]+)\\t', '\\1,', eeFindReplaceCase | eeReplaceAll | eeFindReplaceRegExp,eeExFindSeparateCRLF | eeExFindRegexOnigmo);
Then I get a list of Name,Translation pairs suitable for editing as plain text and put in that textbox.
|
1 user thanked liuxilu for this useful post.
|
|
|
Rank: Newbie
Groups: Translators, Approved Joined: 5/21/2021(UTC) Posts: 2 Location: Brasília
|
I don't know whether this is the right place. I want to translate the help documentation and the software into PT-BR (Brazilian Portuguese). Any advise here?
|
|
|
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.
Important Information:
The StrokesPlus.net Forum uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
More Details
Close