Code::Blocks Forums

User forums => Help => Topic started by: LETARTARE on January 19, 2012, 04:03:52 pm

Title: Use C::B->Tools with Poedit
Post by: LETARTARE on January 19, 2012, 04:03:52 pm
With C::B, I use 'Poedit' from 'Tools' with the parameter
Quote
"$(PROJECT_DIR)$(PROJECT_NAME)"

(the "" allow spaces in macros)

is a project 'project.cbp' and $(PROJECT_NAME) = 'project' and the file 'project.po' in $(PROJECT_DIR)

the call of 'Poedit' load properly 'project.po' with the most part of project
except C:: B.

Indeed, the project name
Quote
'codeblocks.cbp' -> 'Code::Blocks'
and returns the error Poedit 123 (incorrect syntax)

Do you have a solution?

Thank you in advance
Title: Re: Use C::B->Tools with Poedit
Post by: oBFusCATed on January 19, 2012, 04:05:19 pm
What? A better explanation will help us to help you.
Title: Re: Use C::B->Tools with Poedit
Post by: LETARTARE on January 19, 2012, 04:13:02 pm
I'll try ...

'Poedit' looks for the file 'code::blocks.po'
But the symbols '::' are forbidden to name a file.
Should provide 'codeblocks.po'
Title: Re: Use C::B->Tools with Poedit
Post by: oBFusCATed on January 19, 2012, 04:42:25 pm
Try a bit harder, I still don't understand what you're trying to achieve and what is the problem.
Title: Re: Use C::B->Tools with Poedit
Post by: LETARTARE on January 19, 2012, 05:06:18 pm
Thank you for your answers, but the Google translation is not easy ...

I try to open from C::B, a file 'po' corresponding to the active project
If the project is called 'foo', translation file called 'foo.po'
I forgot to mention that I generate this file 'foo.po' from the project name 'foo'
I put it in the project directory

Normally call 'Poedit' (with the parameters of the first post) by the menu 'Tools-> Poedit'  to open 'foo.po' in 'Poedit'

If the project is called 'Code::Blocks', Poedit not find the file 'Code::Blocks.po' because this file is illegal to write with Win32
Quote
'::' Is forbidden to name a file with Vista
Title: Re: Use C::B->Tools with Poedit
Post by: MortenMacFly on January 19, 2012, 05:24:01 pm
If the project is called 'Code::Blocks', Poedit not find the file 'Code::Blocks.po' because this file is illegal to write with Win32
Quote
'::' Is forbidden to name a file with Vista
So why don't you simply rename the project? Is has to match the name of your *.po file anyways - so there is not other solution than that.
Title: Re: Use C::B->Tools with Poedit
Post by: LETARTARE on January 19, 2012, 05:29:59 pm
Thank you for your answer
Of course.
But I was looking for ...
Title: Re: Use C::B->Tools with Poedit
Post by: oBFusCATed on January 19, 2012, 05:30:35 pm
Looking for "$(PROJECT_FILENAME), $(PROJECT_FILE), $(PROJECTFILE) " ?

Another option is to use a full Squirrel script for the expansion. See here http://wiki.codeblocks.org/index.php?title=Variable_expansion (at the bottom of the page)
Title: Re: Use C::B->Tools with Poedit
Post by: LETARTARE on January 19, 2012, 05:39:37 pm
Thanks,
but "$(PROJECT_FILENAME), $(PROJECT_FILE), $(PROJECTFILE) "  will be replaced by 'codeblocks.cbp'
I want 'codeblocks'
I look at your URL
I need a macro like '$ (PROJECT_NAME_LESS_EXT)' !!!
Title: Re: Use C::B->Tools with Poedit
Post by: oBFusCATed on January 19, 2012, 05:44:59 pm
I know, that's why I said you have the option to use squirrel scripts.
Title: Re: Use C::B->Tools with Poedit
Post by: LETARTARE on January 20, 2012, 10:40:02 am
@oBFusCAted
@MortenMacFly
thank you very much

Here's one way to get the name from '$ (PROJECT_FILENAME)', if necessary
Quote
"$(PROJECT_DIR)[[print (ReplaceMacros(_T("$(PROJECT_FILENAME)")).BeforeLast(::EXT_CODEBLOCKS)  );]]po"