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

All about user-defined episode / movie / file name format expressions
Post Reply
Alandil
Posts: 4
Joined: 19 Jul 2021, 19:58

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

Post 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.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

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

Post 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
:idea: Please read the FAQ and How to Request Help.
Alandil
Posts: 4
Joined: 19 Jul 2021, 19:58

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

Post 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.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

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

Post 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
:idea: Please read the FAQ and How to Request Help.
Alandil
Posts: 4
Joined: 19 Jul 2021, 19:58

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

Post 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 ?
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

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

Post by rednoah »

e.g.

Code: Select all

/\b\w\B|\b\w'/
:idea: Please read the FAQ and How to Request Help.
Alandil
Posts: 4
Joined: 19 Jul 2021, 19:58

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

Post by Alandil »

Thx @rednoah !
Post Reply