We are hosting multilingual Plone sites. The default Plone behavior is to use the current content language for admin interface labels. We'd like to change this behavior so that admin interface language is always English, regardless of content.
This will make managing multilingual content easier if you have little or no target language skills.
If we can set this so that when you login as admin and are member of certain or have certain role, the behavior kicks in.
Any suggestions how to do this?
You can register your own INegotiateLanguage multi-adapter from Products.PloneLanguageTool to allow for customisation. IIRC (it was a while ago I added that multi-adapter) you can just register it as an adapter on your own plone.browserlayer interface, though I'm not absolutely certain the browser layer gets applied early enough.
The correct way is to override language when i18n translation machinery queries the string for plone or other i18n domain providing admin text strings.
Overriding request.LANGUAGE has side-effects which will make your site unusuable. E.g. folder listings won't work.
Here is a package which does what you want:
https://github.com/miohtama/silvuple
we had the same requirement and solved it by adding a javascript for managers, replacing the the strings. not ideal because of the redundant vocabulary/dictionary, but worked fine for us.
Related
I am building a website using Symfony. I am wondering how can I change the language of my website by pressing a button.
Say I have two links in the footer (English and German) and when I click any of them, the whole website and all future views I access will remember my choice of language.
There are numerous websites who have this facility and I am wondering how can I achieve this goal.
Thank you!
Recommend checking out the jms/i18n-routing-bundle. You can use buttons or links to change the locale (language) and once changed the site will remain on that language. Just a bit of advice, use the "prefix" strategy when you set it up so that your site's urls will always be domain.com/language/.....
You'll have to learn how to use the translation bundle and setup translation files as well as having to learn how to setup Twig for translations, using the translation in your services and forms, but once you get the hang of it, it is really easy but time consuming.
I'm Working in Plone 4.1 and I'm just curious to know the difference between Products.CMFPlone.interfaces.IPloneSiteRoot and Products.CMFCore.interfaces.ISiteRoot. If I want to register a zope-3 style view, to which one should I register it?
Whenever I want to use a site root, I usually end up using the INavigationRoot from plone.app.layout.navigation.interfaces.INavigationRoot instead.
The INavigationRoot is provided by the Plone site object, but it will also be provided by the navigation root of any subsite or the top level folders in a multi-lingual site. Especially in multi lingual sites, users will never navigate or see the actual site root itself, so any functionality attached to it won't be available to them.
The ISiteRoot only makes sense for things like export import handlers or other internal logic, but not for any enduser visible functionality.
An IPloneSiteRoot is a specific kind of ISiteRoot. IPloneSiteRoot is provided by the root of a Plone site, whereas ISiteRoot is provided by any CMF portal. If your product is only intended to work in Plone, then it doesn't really matter which interface you use. If you want it to be usable with other CMF-based applications, then use ISiteRoot.
Frankly, I usually go with ISiteRoot just because it's shorter to type. :)
I'm searching a CMs that can offer me these features :
Localized fields with a custom number of languages
Each article belong to a category that may have parent categories
language and category could be calculated from url example /en/maincategory/subcategory/my-article-url-rewrite
I was looking in drupal for these features. I haven't yet found something on localization. I have found another solution that could satisfy my need which is Plone but I can't decide which can can give me what I want. Can Drupal do all this ? Plone ? Or there is another solution ?
Plone seems quite a good choice for this project.
Localization can be handled using the excellent product LinguaPlone;
Hierachical categories can be handled using collective.virtualtreecategories, or using hierarchical vocabularies and a custom field with a collective.dynatree widget (I did something similar in a recent project);
Plone does not retrive content using URL dispatch, but path traversal; however, using correct content placement inside folders, you can have a directory structure that complies with your format.
Of course, you will also have access to Plone's powerful User and Group management facilities, ACLs, workflow engine, and many other features.
If you are knowledgable in Python, you might also want to look at Django, which is more like a framework than a CMS, but hey...
Yes, eg. Drupal 6 is able to do that. Just take a closer look at modules:
i18n (shortcut for "internationalization"),
Locale,
Language Icons,
Pathauto,
Transliteration,
etc.
There are a lot of tools for that.
To look for multilanguage-related modules, just follow the link: http://drupal.org/project/modules?filters=tid%3A97%20drupal_core%3A87%20bs_project_sandbox%3A0&solrsort=sis_project_release_usage%20desc
Drupal even provides translation files for its interface and some modules have translation of their interface bundled in the installation files.
If you only need the features you specified, the only thing you need is to install modules you choose, change the default configuration if needed, and you are able to do what you planned :) Drupal has some administration interface that is not friendly to new users, but it is surely able to quickly fulfill your requirements.
If you're using a fixed list of categories and sub-categories then all of your requirements are standard features of the eZ Publish CMS available at http://share.ez.no
If they are not a fixed-list then you may need to create a bit of custom code.
That CMS also uses Zeta Components
(I've posted this on the drupal forum too btw)
I'm converting the company websites to use Drupal, or at least trying to check that its going to be the best way forward. I have a background in PHP development, and I'm currently using the CakePHP framwork. I've built this site (not my design) and I can see how to replicate most of the functionality using Drupal, most likely using the CCK module.
http://preview.tinyurl.com/yk6u8mt
As you can see from the homepage:
A user chooses a country.
The country is passed using an ajax call to a script that decides which phone is best based on 'in country' network coverage.
A div is shown recommending the visitor the best phone for that country.
I'm wondering how to go about this in Drupal, I'm definitely not after a step by step guide, I just want to know if this kind of thing is possible with Drupal, and what approach to use.
If someone can help that would be superb. Thanks.
Okay, so you've got a path you're defining in hook_menu, which is where your form is being presented - or else you've got it set up as a webform in a node, that could work too.
Either way, in your form you're going to be using AHAH - check out http://api.drupal.org/api/drupal/developer--topics--forms_api_reference.html/6#ahah and http://drupal.org/node/348475 .
Basically, you're going to define another path in hook_menu that's of type MENU_CALLBACK, and which will receive the country as input, and then will return the div that you'll display on the screen.
One core example of AHAH that may be useful to you is where you're entering a password and it lets you know if the password is secure enough - check that out.
Edit: There's also some good examples at http://drupal.org/project/examples.
I would look into using CCK and views. you can set up filters for the views. If filters don't work, you have the ability to include php code. I have also successfully added jquery code in the header of a view through which I was then able to have my view filtered by what is typed in a text box.
Coming from CakePHP using Drupal is a pain in the a** - even more for developers.
It's application structure might be designed to ease extensibility but this only means you have a system to enable your own plugins and themes.
While modules are basically the M+C-part the themes are the V-part of an MVC-application. The problem is that this seperation is not very strict in Drupal - in fact you have to break it sometimes in order to make things work (e.g. you have to include a theme_mymodule_myfunction() into your module as default output which you then can override with your theme using mytheme_mymodule_myfunction() ) And don't even bother looking for classes ( see http://drupal.org/node/547518 ).
Also there is no real link from a module to a theme. On many occations this is a good thing as you can switch modules and themes seperatly without creating a problem. For application builders coming from CakePHP (or any other framework) you often feel a lack of "wholesomeness" - you create parts for a base software and have to live with it's drawbacks.
IMHO I wouldn't recommend this step. Drupal is fine if you have to manage a website and might add a few modules to add neccessary value (image gallery etc.) but I definetly don't recommend it as a base for a customized web-app.
I'm about to embark on a journey to build a multilingual Drupal site, where I will most likely have to use Views, Panels and Taxonomy pretty heaily. I am a bit worried about the new-node-for-every-language approach, especially using Panels.
So far I've gotten it to work similarly to what I want by not having multilingual support for the Panels content-type, and fetching content that is from Current language and language neutral . This seem to work as expected, but I'm seeing some problems with it. There might be the occasion that I will have to have a language specific Panel (not published in English for example). If I need to have all my Panels multilingual, there seems to be alot of work to place the nodes for every column in every page in every language. I'm thinking I could possibly solve this by fetching the content with some kind of view with arguments, but this will most likely also lead to alot of work.
Is there some proper way of doing what I'm attempting to describe, or do I have alot of seemingly unnecessary work to expect?
I assume you have i18n module (http://drupal.org/project/i18n) and Views module installed. Then you can create a view for each language - one can choose language in "Filter" section of the view definition.
Once you have views, then you can link them to menus or blocks. The problem is you must have a separate version of block or menu for every language, with a proper view associated - Drupal is choosing proper language version itself according to the configuration (typically content type set in a browser). I haven't found any easier way of doing that.
Fortunately preparing multilingual content is not that hard thanks to the "transalte" functionality for nodes after enabling i18n module, so new node for every page is something one can live with.
BTW you are right that the way Drupal is doing i18n is not the best solution one can think of. I am having hard time with it sometimes.
Well there are some serious issues with views over translating taxonomy terms or vocabs names. This could be resolved with some extra modules or / and custom PHP code inside views fields. Usually 70% of modules does not support translation, then you need to patch them to support it. While others does have translation possibility, but it could be two possible ways: uses variables table to hold different translations UI dependent (need to switch to other language to find a string) or uses translation field tables to utilize "translation interface" from admin menu.
So far that's it :)
I wish you luck!