I can’t find any documentation about returning the date in another language using Swig’s date filter.
Is there something I missed, do I have to setup a locale in NodeJs like in PHP or is there simply no internationalization with Swig ?
Related
Just like the title says, I would like to set the global default for the to_char function in Postgres. I considered this:
to_char(date_test, SELECT datestyle FROM settings)
But that seems hacky. Any better ideas?
Explanation: I want my database to present the date in a user settable format. So far, this is what I came up with. But I would appreciate a more fluent way if possible. The Postgres OUTPUT option does not support all formats.
Edit: I already formatted the date the way I want it. This is an open source app, and I want a clean way for other people to format the date. Preferably server side, since there have been requests for all server side computation to support selectable frontends.
It seems dangerous to let the user freely choose the date format, it would be better to give a choice of formats.
There is no “default format” in PostgreSQL. I would format the dates in the application rather than in the database, but you can keep the selected format in a variable and feed it to to_char whenever you need.
I have a column that have been set to Localized="true", is there a way to add a finder that only matches LIKE on specific locale?
Unfortunately, I don't think it would be possible: localized columns are stored as xml strings in db, and I haven't found any example of a search like this in Liferay source. Have you considered using the index? It would be way easier to do a LIKE query for a localized field.
You can use xPath (if you use a db engine that supports it, for example postgresql)
I need to change the language of whole project. I am using jsf. In default I used English. Now i need to convert it in Italian and Spanish.
I did it by manually writing in the property class. Just like:
and in xhtml I need to to put the property by manually.
My question is that, is there any way to convert it automatically?? I mean I just click on Italian, and it will display in italian language.
You need to create one file by language (with the correct name)
And fill every - key manually ...
Netbeans help you to display all languages in the same table.
The automaticaly option is Google trad.. it's not good solution.
I am using Google Doc viewer to show online PDF url like this: https://docs.google.com/viewer?url=www.education.gov.yk.ca/pdf/pdf-test.pdf and I am using this URL using a javascript open window action like this:
window.open(url,target='_blank','width=800,height=600,scrollbars=1');
where URL is https://docs.google.com/viewer?url=www.education.gov.yk.ca/pdf/pdf-test.pdf
My question is: Google doc viewer takes language as English by default. Can I change this language somehow so that buttons next/previous on screen appear in Dutch and not in English?
You can add the hl query parameter to specify a different locale using ISO language codes. For instance, to use Dutch you should add &hl=nl as in the following link:
https://docs.google.com/a/google.com/viewer?url=www.education.gov.yk.ca/pdf/pdf-test.pdf&hl=nl
This is a pretty simple question, I just can't seem to find the information on it. In expression engine, is it possible for {segment_1} to be a dynamic variable. I.E. if I wanted to take my URL structure from:
http://www.whatever.com/category/football/green-bay/
to:
http://www.whatever.com/football/green-bay/
I don't want to actually create the directory for football within my code(as this is just an example, and the amount of base categories is in the hundreds), I just want it to map to my templates/category page.
I know this could probably be accomplished somehow through mod_rewrite, but that's what I'm trying to avoid. I'm trying to see if there's a built in way in Expression Engine to accomplish this.
This sounds like the sort of functionality that the MD Detect Pagetype plugin offers. The plugin "listens" to a certain URL segment to determine what type of page is being displayed. It then gives you access to the following conditionals:
{exp:md_detect_page_type url_segment="{segment_3}"}
{if pagination_page}This is a Paginated Page{/if}
{if category_page}This is a Category Page{/if}
{if yearly_archive_page}This is a Yearly Archive Page{/if}
{/exp:md_detect_page_type}
Visit the website linked above to download and find out more about the free plugin.