Use Flags instead of links for language switching? - multilingual

Is there a way to use flags instead of the language shortcodes for the language switcher links in ImpressPages 4?
Unfortunately I wasn't able to find any information on this and am not really clear where that code is generated in the php files...
many thanks
Michael

You need to override default view file that prints language selection. In this case it's Ip/Internal/Config/view/languages.php
To do that you need to create a corresponding file in your theme's override directory. The path to the file should be like this - Theme/YOUR_THEME_NAME/Ip/Internal/Config/view/languages.php
More about view file and how to override them - http://www.impresspages.org/docs/view
Just copy the original view file to a new location and make any changes you like. And you'll be safe with system updates.

Related

WPF Localization Language Groups

I have a standard WPF localized application using .resx files. At the moment I have support for en-US (default) en-AU, es, and zh-CN.
Do I need to have a separate resx file for each language, or is there some way to group them? For example, I imagine people with region id en-GB would prefer en-AU over en-US. or zh-TW would definitely prefer zn-CN over en-US. I could certainly just copy the files, but is there an easier way?
You need a seperate resx file for every language and each file has to have the same keys. The matching resx file will be choosen automatically.
You can have one default resx file if that's what you wanted to know, too.
A bit late to this question but I just found it so I might as well give an answer.
I guess there are two options, depending on your needs:
You can define a "Resources.en.resx" that en-GB users will fall back to if there is no specific en-GB resource file defined.
en-GB users will try to look for resources in the following order:
Resources.en-GB.resx
Resources.en.resx
Resources.resx
This works per resource entry. You can define all common "en" resources in Resources.en.resx, and only the differences in Resources.en-AU, so you don't have to copy paste all resources.
You can also manually set the culture depending on the language code: if the user is in en-GB, you could just set the culture to en-AU:
CultureInfo userCulture = CultureInfo.InstalledUICulture;
if(userCulture.Name == "en-AU") // do what you want

How can I download a PDF file from a form using UI designer?? Bonita

The thing is I have found how upload a document and after that downolad it. But I just want to download it. I want to do it using the UI designer but I dont know how to do it.
Thanks :)
I dont know which tool are you using to design your UI, anyway this is concerning functionality, not design. In that point, i need to know wich language do you want (or can) use. For example, in PHP, it's very simple, you can make something like:
(create php file) downloadpdf.php
1st: (if you want to generate pdf "on the fly":
<?php
function download($foo){
content headers (type, force-download, etc)
database select to get data or harcode it.
echo data
}
?>
and call this function with some id to select from database or something (ignore if you want to hardcode it)
Other option to download a file, if it's stored on server is making a link to this file (statically or dyamically). If you wanna take control to file downloads, check this post:
http://www.media-division.com/the-right-way-to-handle-file-downloads-in-php/
I don't mean that it can be done with UI designer tools, and it's not concerned if it's from a form or not.
Cheers!
You should create link and variable which type is javascript expression. On Variable value write
return "/bonita/portal/" + $data.context.mainDoc_ref.url;
On link URL write your variable and to text
Download: {{context.mainDoc_ref.fileName}}
Here you can find excellent example for this case

Is there any utility/plugin for vim editor to add comments/headers?

I have searched a number of plugins for adding automatic/manual headers/comments/function details in any C/C++ file when open in vim editor, even tried using .vimrc file using autocommands. But they are for while opening a new file. Is there any same for already existing files?
Its very tedious for adding information about a code/function in a large code-base.
lh-cpp provides:
customisable templates for file headers
loaded automatically when a new file is created from the file template, before expanding the dedicated .h/.cpp file template
or on demand as they are 3 ways to trigger a template/snippet expansion (automatically on new files, or on demand with :MuTemplate c/internals/c-file-header here (you can also set an alias to something else) or on snippet expansion). As lh-cpp/mu-template snippets/templates are actually similar to functions/variations points, you can ask to expand only file headers (which are customizable on a per-project basis), or anti-reinclusion guards, and so on.
:DOX command that analyses functions signature to fill the function headers as best as possible
advanced snippets for various kind of classes (entity classes, base classes, copiable classes, exception classes, ...) and should eventually fill as much information as possible in the class doxygen from the class semantics -- I just didn't have enough time yet to implement this feature.
There are at least two approaches, one using abbreviations and one using snippets.
For example, you could use Ultisnips to add a pre established header.

How to read __() in Cakephp .ctp files with poedit?

How do i use Poedit to read strings embedded in __(). It's a Cakephp .ctp file. At the moment it only works if i remove one underscore: _(). I know how to use the console but i want to use Poedit.
Catalog -> Properties -> Source keywords and add __, because unlike _ it is not xgettext's default.
Just guessing, BTW, because your question leaves a lot to be desired in terms of usable details.
Read the books page about i18n & i10n.
You have to use the shell to generate the catalogue files and you open these files with poedit not your template files. That's how it works.
Have a read how gettext works. Translating something is more than just replacing a string...
So to make it easier if you can't have your ctpo file parsed by poedit.
Open poedit, in the "files" => "preferences" check the extractors tabs, choose php for modification, add *.ctp to the extension lists.
Save and update your list, translations from ctp files should be there now.
Enjoy !
You should indeed use your console to generate a pot file but, for example, i'm working on a project where everything is online on a mutualised server, i don't have access to any console.

cakephp, i18n .po files, How to use them correctly

I have finally managed to set up a multilingual cakephp site.
Although not finished it is the first time where I can change the DEFAULT_LANGUAGE in the bootstrap and I can see the language to change.
My problem right now is that I cannot understand very well how to use the po files correctly.
According to the tutorials I've used I need to create a folder /app/locale and inside that folder create a folder for each language in the following format: /locale/eng/LC_MESSAGES.
I have done that and I have also managed to extract a default.pot file using cake i18n extract. And it appears that all occurrences of the __() function have been found succesfully.
In my application I'm using 2 languages: eng and gre.
I can see why you would need a seperate folder for each language.
However in my case nothing happens when I edit the po files inside each folder....well almost nothing. If I edit the /app/locale/gre/LC_MESSAGES/default.po I have no language changes. If I edit the /app/locale/eng/LC_MESSAGES/default.po then the language changes to the new value (on the translation field) and it does not switch to the other language.
What am I doing wrong.
I hope I made myself as clear as possible.
There are different ways to go about it. The easiest is to code the app in the primary language and to just wrap all translatable strings in __(). Later you can add .po files for each translation you may want.
The problem with this approach is that if you were to change the text in the original language, you'll also need to change the msgid entry for this string in every .po file you may have. This can become quite cumbersome if you have to support many different languages.
Please disregard the old information above. A properly set up i18n workflow will use xgettext or similar utilities to automatically extract __() wrapped strings from the source code and produce, update and merge .po files. Nothing cumbersome about it.
The alternative is to use a "descriptor" text in the source files and put the actual text in .po files, even for the primary language. I.e:
__('PRODUCT CAPTION');
/eng/.po
msgid "PRODUCT CAPTION"
msgstr "Buy our awesome products!"
/ger/.po
msgid "PRODUCT CAPTION"
msgstr "Kaufen Sie unsere Produkte!"
What works better depends on the project and on you, you'll have to figure it out...
Use
Configure::write('Config.language', 'fr');
to set the language of the user to french.

Resources