Author |
Message |
SFR

Joined: 26 Oct 2011 Posts: 1749
|
Posted: Wed 07 Oct 2015, 05:50 Post subject:
|
|
666philb wrote: | hi SFR,
i'm getting this error on the pinstall.sh Code: | multirename-1.4/pinstall.sh: line 23: syntax error near unexpected token `fi' |
|
Thanks, Phil. Fixed and reuploaded.
Btw, the error (caused by a lonely 'fi' at the very end of the script) wasn't disturbing the proper execution during normal install, but probably could break it while building with Woof-CE...
Greetings!
_________________ [O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource
Omnia mea mecum porto.
|
Back to top
|
|
 |
SFR

Joined: 26 Oct 2011 Posts: 1749
|
Posted: Sat 24 Oct 2015, 12:28 Post subject:
|
|
Version 1.6
I added an option to manually rename selected item.
Just right-click (or shift+enter) it and appropriate dialog will show up.
Greetings!
_________________ [O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource
Omnia mea mecum porto.
|
Back to top
|
|
 |
MochiMoppel

Joined: 26 Jan 2011 Posts: 1944 Location: Japan
|
Posted: Sun 25 Oct 2015, 01:57 Post subject:
|
|
Hi SFR, manual editing ... it's getting sophisticated
I was a bit confused by the dialog. My proposal:
- Avoid the impression that the first field is editable
- Always fill the second field with a default. Makes editing much easier
- Put the focus on the second field, not the first
This worked better for me:
<frame '$(gettext "Rename the item manually")'>
<hbox>
<entry editable="false" has_frame="false">
<variable>varMANUAL_OLD</variable>
<input file>"'${TMPDIR}/manual_old'"</input>
</entry>
<pixmap stock-icon-size="3"><input file stock="gtk-go-forward"></input></pixmap>
<entry has_focus="true">
<variable>varMANUAL_NEW</variable>
<input>N="'$(<${TMPDIR}/manual_new)'"; [ "$N" ] && echo $N || echo "'$(<${TMPDIR}/manual_old)'"</input>
</entry>
</hbox>
</frame>
|
Back to top
|
|
 |
SFR

Joined: 26 Oct 2011 Posts: 1749
|
Posted: Sun 25 Oct 2015, 05:45 Post subject:
|
|
MochiMoppel wrote: | Hi SFR, manual editing ... it's getting sophisticated |
Hi Mochi
Well, suspiciously often there's a black sheep in a group of similarily named files:
Quote: | 01-somename
02-another
03 -black sheep
04-this one's normal |
Manual editing is quite helpful in such cases.
Quote: | I was a bit confused by the dialog. My proposal:
- Avoid the impression that the first field is editable
- Always fill the second field with a default. Makes editing much easier
- Put the focus on the second field, not the first
This worked better for me:
<frame '$(gettext "Rename the item manually")'>
<hbox>
<entry editable="false" has_frame="false">
<variable>varMANUAL_OLD</variable>
<input file>"'${TMPDIR}/manual_old'"</input>
</entry>
<pixmap stock-icon-size="3"><input file stock="gtk-go-forward"></input></pixmap>
<entry has_focus="true">
<variable>varMANUAL_NEW</variable>
<input>N="'$(<${TMPDIR}/manual_new)'"; [ "$N" ] && echo $N || echo "'$(<${TMPDIR}/manual_old)'"</input>
</entry>
</hbox>
</frame> |
Hmm, 'has-focus' crossed my mind - I don't know why didn't I use it.
Anyway, I like the changes and they will be in next version (thanks!), with slight modification of <input>...</input> part, because some characters in names (especially <) can break it, so we have to use cat instead:
Code: | <input>[ -s "'${TMPDIR}/manual_new'" ] && cat "'${TMPDIR}/manual_new'" || cat "'${TMPDIR}/manual_old'"</input> |
(of course I also added '-n' to both 'echo -n "$MANUAL... > $TMPDIR/manual...' lines)
Greetings!
_________________ [O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource
Omnia mea mecum porto.
|
Back to top
|
|
 |
MochiMoppel

Joined: 26 Jan 2011 Posts: 1944 Location: Japan
|
Posted: Sun 25 Oct 2015, 06:29 Post subject:
|
|
SFR wrote: | we have to use cat instead | Beware, this will make you a candidate for the Useless Use of Cat Award
If you need to employ a (useful) cat, make it a cat with a tail:
Code: | <input>cat "'${TMPDIR}/manual_old'" "'${TMPDIR}/manual_new'" | tail -1</input> |
Quote: | (of course I also added '-n' to both 'echo -n "$MANUAL... > $TMPDIR/manual...' lines) | In my version '-n' must not be added to echo "$MANUAL_OLD", only to echo -n "$MANUAL_NEW", otherwise cat will not work as expected. It seems to work, but I haven't tested with all your odd filenames, so I leave it as an idea.
|
Back to top
|
|
 |
L18L
Joined: 19 Jun 2010 Posts: 3450 Location: www.eussenheim.de/
|
Posted: Sun 25 Oct 2015, 12:11 Post subject:
MultiRename v1.6 Subject description: i18n |
|
MochiMoppel wrote: | As for the show stopper: Sorry for that, the show can go on. |
Here we go.
Used recent momanager to create a 1st translation.
2 small changes made by me in the script:
my multirename line 777 wrote: | <text><label>"'$(gettext "\-digit sequence")'"</label></text> | ... and it can be translated
and
my multirename line 840 wrote: | <button use-stock="true" label="gtk-quit">
<action>exit:exit</action>
</button>
| ... and 1 (one) message less to translate.
Description |
|
Filesize |
12.26 KB |
Viewed |
361 Time(s) |

|
Description |
German translation save to /usr/share/locale/de/LC_MESSAGES/multirename.mo (remove fake .gz)
|

Download |
Filename |
multirename.mo.gz |
Filesize |
2.76 KB |
Downloaded |
272 Time(s) |
|
Back to top
|
|
 |
SFR

Joined: 26 Oct 2011 Posts: 1749
|
Posted: Sun 25 Oct 2015, 16:10 Post subject:
|
|
@Mochi: Well, I think uselessness/redundancy is only when you use 'cat single-file | ...' rather than 'cat single-file' alone.
Your version seems to work fine with f#cked up filenames, too, however I'll keep mine, since it appears to look more explicit and consistent, at least to me. Hope you don't mind.
@L18L:
Code: | <text><label>"'$(gettext "\-digit sequence")'"</label></text> |
Hmm, I thought that $(gettext -- "-digit sequence") will be ok...
Anyway, fixed in v1.7.
Code: | <button use-stock="true" label="gtk-quit"> |
This does not translate if I use 'LANGUAGE=de multirename', so I have left it as it was, for consistency.
And thanks for the translation - added to NLS pet.
Greetings!
_________________ [O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource
Omnia mea mecum porto.
|
Back to top
|
|
 |
L18L
Joined: 19 Jun 2010 Posts: 3450 Location: www.eussenheim.de/
|
Posted: Mon 26 Oct 2015, 06:28 Post subject:
gtk-quit |
|
SFR wrote: | Code: | <button use-stock="true" label="gtk-quit"> |
This does not translate if I use 'LANGUAGE=de multirename', so I have left it as it was, for consistency. | consistency is good.
Code: | LANGUAGE=pl multirename | works OK (Zakoncz) here, fd64_nls.sfs loaded.
Code: | # cd /usr/share/locale/pl/LC_MESSAGES
# msgunfmt gtk20.mo | grep -A1 Quit
msgid "_Quit"
msgstr "Za_kończ"
# | Strange thing this.
---
EDIT
It is not strange. Without gtk20.mo no translation.
Last edited by L18L on Mon 26 Oct 2015, 12:48; edited 1 time in total
|
Back to top
|
|
 |
L18L
Joined: 19 Jun 2010 Posts: 3450 Location: www.eussenheim.de/
|
Posted: Mon 26 Oct 2015, 06:30 Post subject:
gettext |
|
SFR wrote: | I thought that $(gettext -- "-digit sequence") will be ok...
Anyway, fixed in v1.7. |
Thinking is good, trying is better.
If you had been using momanager you would have this strange pair:
msgid: "--"
msgstr ""
If you don't like to use momanager here is how to check it directly in console:
Code: | # LANGUAGE=pl xgettext -L Shell -o - -
$(gettext -- "-digit sequence")
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-10-26 10:54+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
#: standardowe wejście:2
msgid "--"
msgstr ""
# | Note,
LANGUAGE=pl is used here just to produce "standardowe wejście".
Parameters see: xgettext --help.
if gettext uses 2 parameters, the 1st is textdomain.
But xgettext always takes the first parameter of gettext.
Thanks to your -digit sequence I found that - has to be escaped by backslash. Result: Code: | #: standardowe wejście:1
msgid "\\-digit sequence"
msgstr ""
# |
---
Note about momanager for this 1st translation test,
if using momanager and changing something in the script then simply rm /tmp/monager/script.pot and it will be re-created from the actual changed script.
---
EDIT another note,
If you don't like to check just open a thread in Localization Project where some checkers always lurk around.
|
Back to top
|
|
 |
SFR

Joined: 26 Oct 2011 Posts: 1749
|
Posted: Mon 26 Oct 2015, 07:36 Post subject:
|
|
L18L wrote: | works OK (Zakoncz) here, fd64_nls.sfs loaded. |
Oh, I don't have NLS loaded (my OSes have always been English-only with exception of keyboard layout.
Perhaps 'k' is the standard shortcut for this label in Polish..?
L18L wrote: | If you had been using momanager |
I used to, but I don't do translations anymore - I never liked it and I suck at it.
Although I still do i18n my apps, so thanks for explaining the momanager/(x)gettext stuff.
Greetings!
_________________ [O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource
Omnia mea mecum porto.
|
Back to top
|
|
 |
ASRI éducation

Joined: 09 May 2009 Posts: 3203 Location: France
|
Posted: Mon 26 Oct 2015, 08:33 Post subject:
|
|
I just found this interesting discussion. I subscribe...
_________________ Projet ASRI éducation => Association | Forum | Dépôt | Espace kids
|
Back to top
|
|
 |
L18L
Joined: 19 Jun 2010 Posts: 3450 Location: www.eussenheim.de/
|
Posted: Mon 26 Oct 2015, 12:58 Post subject:
shortcuts |
|
SFR wrote: |
Perhaps 'k' is the standard shortcut for this label in Polish..? |
Yes it is, translator has to choose the shortcuts.
And thank you for continuing to do i18n in your highest appreciated apps!
|
Back to top
|
|
 |
jplt

Joined: 12 Nov 2010 Posts: 282 Location: Terre
|
Posted: Tue 27 Oct 2015, 04:43 Post subject:
|
|
Hi all,
i have thousands of files in a directory and i want the rename them all,
by selecting (and not go inside it !) the directory i imagine a select box that tell me :
rename this directory or rename all the files in this directory ?
I don't if is it possible ?
By the way thanks SFR for all your scripts .
_________________ Precise , Tahr
|
Back to top
|
|
 |
SFR

Joined: 26 Oct 2011 Posts: 1749
|
Posted: Tue 27 Oct 2015, 10:10 Post subject:
|
|
jplt wrote: | i have thousands of files in a directory and i want the rename them all,
by selecting (and not go inside it !) the directory i imagine a select box that tell me :
rename this directory or rename all the files in this directory ?
I don't if is it possible ? |
Hi Jplt
It is possible in general, but MR wasn't designed to act like this.
IMO recursive renaming would be too messy and too many things could go wrong.
If you need to rename all files in a directory, just go into that dir and select all of them (Ctrl+A).
Btw, processing 1000+ files may take a while, so if you're impatient, perhaps an alternative written in compiled language (like gFnRename) would do better in such cases...
L18L wrote: | And thank you for continuing to do i18n in your highest appreciated apps! |
jplt wrote: | By the way thanks SFR for all your scripts . |
You're welcome!
Greetings!
_________________ [O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource
Omnia mea mecum porto.
|
Back to top
|
|
 |
SFR

Joined: 26 Oct 2011 Posts: 1749
|
Posted: Mon 13 Jun 2016, 10:19 Post subject:
|
|
Version 1.8 uploaded.
See 2nd post for changelog.
Greetings!
_________________ [O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource
Omnia mea mecum porto.
|
Back to top
|
|
 |
|