Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #10586

    Robert J. Klop
    Participant

    I am looking for an option like ‘search and replace’ but then ‘search and insert, whit as sub-choices, insert before / insert after a character or word.

    I’ll try to explain why:
    As a professional translator i often have .js files to translate. Some of them are not regularly formatted and i have to format them by hand which is a lot of work. All strings are some times in one enormous long line (files are some 200KB or bigger) where i have to look for comma’s, :{, and other tags to insert a LF/CR and then insert one two or tree TABS. See below (the words in single quotes are the to be translated strings):

    tinyMCE.addI18n({'en':{'dlg':{modified:'Modified',file:'File',folder:'Folder',files:'files',folders:'folders',comments:'Comments',size:'Size',preview:'Preview',duration:'Duration',dimensions:'Dimensions',contents:'Contents',unwritable:'Unwritable' etc. etc.

    It should be manually formatted as:

    tinyMCE.addI18n({'en':{
    'dlg'
    :{
    modified:'Modified',
    file:'File',
    folder:'Folder',
    files:'files',
    folders:'folders',
    comments:'Comments',
    size:'Size',
    preview:'Preview',
    duration:'Duration',
    dimensions:'Dimensions',
    contents:'Contents',
    unwritable:'Unwritable'
    etc. etc.

    It would be great to have this work automated in emEditor in the near future. This is what i mean whit a new option like ‘search and insert’.

    Kind regards, Z. 😉

    #10587

    Stefan
    Participant

    Sorry, i don’t understood.
    I see nothing which is “insert before / insert after”.

    Rather i see an “break at comma” reformating.

    I would do it like this:
    – format the first lines yourself till the “modified:”

    – next do an search&replace:
    Find: ,
    Replace with: ,n
    [X]Use Escape Sequence

    – next do the indenting

    @Yutaka, this search&replace doesn’t respect this setting:
    “Configuration – General tab – Tab/Indent > [X]Enable Auto Indent”
    I had expected it would be auto -indent with s&r n too.

    #10588

    Robert J. Klop
    Participant

    Thanks for your hint Stefan.

    I find it still to much work though, I need a more precise way without all the hassle. It is not only just replacing a character sequence but I am looking for a smooth and mistake-less way because the jscript code has to stay in tact and that isn’t always the case this way. It is however a way to give it a try, better anyway then doing all the string separations by hand.

    Z. 🙂

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.

Share with friends... Tweet about this on TwitterShare on FacebookShare on Google+Email this to someone