Is it possible to create multi language web pages with database resource?
Instead of "messages_EN.properties", "messages_HU.properties", and so on... I'd like to keep those texts in database. Is it possible to use this in the same way as properties files? For instance #{messages.hello} would depend on the current users language, and the text would be loaded from database, not properties file.
First you should check this:
Correct java.util.ResourceBundle Organization
The way to do it is described here:
messages.properties taken from db
Related
How can i localize the drop down option for the search mode? I did some digging and was able to adjust the localization for the search form labels but i'm at loss here.
The CMS Module SearchDialog.ascx call the drop down list here, but i can't see where the values come from.
<cms:CMSDropDownList runat="server" ID="drpSearchMode" CssClass="DropDownField" />
Go to the localization App and create resource strings for
"srch.dialog.AllWords"
"srch.dialog.AnyWord"
"srch.dialog.anywordorsynonyms"
"srch.dialog.ExactPhrase"
Believe those are the 4 you need.
I couldn't find official documentation that helps much with this, though there have been articles in the past on older versions. However, one trick I've used previously is to look in the ~/CMSResources/cms.resx file, find the localized string there, and add a new one with the same key to the Localization module in Kentico. That is, add a new resource string in Kentico with the same key (the naming will be different depending on your version of Kentico).
Here's the docs discussing setting up a multilingual interface: https://docs.kentico.com/display/K9/Setting+up+a+multilingual+user+interface
And here's a screenshot of the resx file:
So in your case I'd create a new resource string within Kentico called "srch.dialog.allwords" as an example and that should overwrite and take priority over whatever is in the .resx file, plus you can manage it via the Kentico admin. There may be a quicker or more reliable way to view the list of default resource strings but in my recent installs of Kentico, the list is hidden from the admin interface.
Alternatively, of course, you could manage the resource strings via various .resx files as in the documentation, but I try to manage as much of these pieces via Kentico as possible for convenience.
I need ti develop multilanguage webiste with (russian, english and kyrgyz languages), each article has version only in one language.
Can you please help me with questions:
1. how to create context for kyrgyz language? is it just put culturekey=kg?
2. how to translate oarts of chunks, i.e "comments" or buttons? do I need to create different chunks for new contexts? Or I simply save translation somewhere?
3. how to control which resources will be shown through pdoresources (getresources)? do I need to put id from all contexts?
4. for context web — pages has alias mywebsite.ru/category/article, but for "en" context — mywebsite.ru/en/INDEX/category/article. how to remove index? when i try to use link like mywebsite.ru/en/ — it shows 503 error. what can be the problem?
Thanks!
Create new context
Use lexicon entry. If you don't want to create a new namespace, just use core.
If you read the documentation, you can see the available parameters to define the parent, resources, or excluded resources to show.
You need to check your .htaccess and all friendly URL settings. 503 itself means unavailable site. Check your system settings, and search for site_status key. It should be "yes" for a running website.
Looking through orchard examples and I was wondering when is the correct time to use (for exmaple im using customer so...)
CustomerPart or CustomerPartRecord. when referring to them in Orchard projects?
Most of the time you want to use the part. The record is used for storing the data in the part to the database. View templates and Drivers will refer to the part and the handler will say how the record is persisted.
If you follow the example through for Creating a Simple Orchard Module and do as they do, it should become clearer. In particular check the 'Creating the Model for the Part' section.
Currently, we're running revolution 2.2. On site_content, we have some tags that are ran for crawling twitter. I want to start tracking the number of results for each tag as results come in, to determine which tags don't return that many results, etc.
So I was thinking that I should create a new table (twitter_data), and have a foreign key that will link it to the search tag ID, which is stored in site_content.
What is the best path to accomplish this? Should I create my table then run the reverse schema tool, outlined here?
http://rtfm.modx.com/display/revolution20/Reverse+Engineer+xPDO+Classes+from+Existing+Database+Table#ReverseEngineerxPDOClassesfromExistingDatabaseTable-CreatingaMySQLtable
I also found this, but not sure if this is what I should be looking into:
http://rtfm.modx.com/display/revolution20/Using+Custom+Database+Tables+in+your+3rd+Party+Components
Probably not - if you can avoid modifying the core modx schema do so. an external table may be your best option, but requires a fair bit of work.
though if you can explain wht you mean by 'tags' a little better [html tags? snippets? content tags? not sure what you mean] there may be other options. for example. one of our clients wanted to count page hits [and didn't want to use google to do it] so all we did was to create a template variable bound to each page they wanted to count and then updated that appropriate variable by writing plugin to fire on the onpageload or onpagerender event. [I don't ermember exactly which or what it was called]
Basically, you may be able to do this by writng a plugin rather than trying to extend anything or add snippets/chunks.
I have a webapp written in JSF, CDI and Seam 3 and I have a properties file with all strings that are rendered in all the views, however, I wonder if it's better to have a properties file for each one of the views or have only one with a lots of values.
Are there any best practises for having a well structured properties file?? Having one properties per view is a good "properties design"??
I thing that having one properties per view means that when you delete one view or refactor something you have to change a lot of files (properties), if you're application is ready for displaying many languages... probably it's better having only one with all the strings...
Any suggestions??
thanks
If goal is multilanguage support. I think you must have one file for each language.