Page 1 of 1

[FRENCH] Uppercase after an aporstrophe (or other character)

Posted: 19 Jul 2021, 20:06
by Alandil
Hi,

I try to rename episodes of the TVshow Falcon And The Winter Soldier. In French, it's Falcon Et Le Soldat De L'Hiver

With filebot, all my tests give me :

Falcon Et Le Soldat De L'hiver

But i'ld like an uppercase after the apostrophe, for the "h" of the word "hiver".

Someone can help me with the format expression ?!

Thx a lot.

Re: [FRENCH] Uppercase after an aporstrophe (or other character)

Posted: 20 Jul 2021, 02:09
by rednoah
The official name is Falcon et le Soldat de l'hiver but you can always write custom format code to fix things up. The built-in n.upperInitial() can't be used in this case because it doesn't capitalize letters after ' due to this not being desirable in other languages.


e.g. match custom regular expression replacement:

Code: Select all

n.replaceAll(/\b\w/){ it.upper() }

Code: Select all

Falcon Et Le Soldat De L'Hiver

Re: [FRENCH] Uppercase after an aporstrophe (or other character)

Posted: 20 Jul 2021, 08:12
by Alandil
Thx for your tip ! You save me :D

Can you tell me how to manage in the same time english title like "Jupiter's Legacy" ?

With your tip, i get "Jupiter'S Legacy". It's only for the titles with a single character after an apostrophe.

Re: [FRENCH] Uppercase after an aporstrophe (or other character)

Posted: 20 Jul 2021, 09:53
by rednoah
You'll have to learn and play with regular expressions until you can match exactly the characters you want to upper case:
https://regexr.com/6271t

Re: [FRENCH] Uppercase after an aporstrophe (or other character)

Posted: 21 Jul 2021, 17:18
by Alandil
Thx. I've tried a lot of expressions but

Code: Select all

n.replaceAll(/\b\w\B/){ it.upper() }
give me :
Jupiter's Legacy >> OK
Falcon Et Le Soldat De l'Hiver >>> NOK on the last "l". I would like "L'Hiver"....

Possible ?

Re: [FRENCH] Uppercase after an aporstrophe (or other character)

Posted: 21 Jul 2021, 19:06
by rednoah
e.g.

Code: Select all

/\b\w\B|\b\w'/

Re: [FRENCH] Uppercase after an aporstrophe (or other character)

Posted: 26 Jul 2021, 12:26
by Alandil
Thx @rednoah !