A workaround to building dynamic multilingual Wix pages? - multilingual

There's no "out of the box" option to create multilingual dynamic pages in Wix platform.
My idea is to have a single data table where I would store the same data in multiple languages (separate columns: Title EN, Title DE etc.). I would then trigger one or the other data column based on the language a user chooses to view the page in.
Has anyone had the same issue on Wix and maybe manages to find a workouround using some Java script magic?
Thanks for the help in advance!

What you are suggesting should work fine. You can either store all the languages in a single collection or have a collection per language. I think a collection per language would probably be easier if you keep the field names the same because you could use the same exact queries, just on a different collection.
Then you can use the currentLanguage property to determine which collection to query.

Related

Database Driven Model Mapping in Java

So, I have a project where I get data from a dozen different sources, some are database objects, most often the data is in different JSON formats, or often XML formats. So, I need to take this disparate data and pull it into one single clean managed object that we control.
I have seen dozens of different posts on various tools to do object to object mapping. Orika being one of them, etc. But the problem is that Orika, like many of these still need solid classes defined to do the mapping. If there is a change to the mapping, then I have to change my class, re-commit it, then do a build and deploy new code ... BTW, testing would also have to be done like any code change. So, maybe some of these tools aren't a great solution for me.
Then I was looking to do some sort of database-driven mapping, where I have a source, a field, and then the new field or function I would like to take it to. So, with a database-driven tool, I could modify the fields in the database, and everything would keep working as it should. I could always create a front-end to modify this tool.
So, with that ... I am asking if there is any database-driven tool where I can map field to field, or fields to functions type of mapping? Drools was my first choice, but I don't know if it is my best choice? Maybe it is overkill for my needs? So, I was looking for advice on what might be the best tool to do my mapping.
Please let me know if you need any more information from me, and thanks for all the help!
Actually Orika can handle dynamic Data source like that, there is even an example on how to convert from XML Element (DOM API) or even JsonObject.
You can use an XML parser to convert your data into Element object, or Jackson to get JsonObject
Then define you class map between your "Canonical" Java Class and these dynamic "Classes"
http://orika-mapper.github.io/orika-docs/advanced-mappings.html Customizing the PropertyResolverStrategy
Here is an example of Orika mapping to MongoDB DBObject to Java Bean
https://gist.github.com/elaatifi/ade7321a1405c61ff8a9
However converting JSON is more straightforward than XML (the semantic of Attributes/Childs/Custom tags do not match with JavaBeans)

Generate a series of documents based on SQL table

I am trying to formulate a proposal for an application that allows a user to print a batch of documents based on data stored in a SQL table. The SQL table indicates which documents are due and also contains all demographic information. This is outside of what I normally do and am trying to see if these is a platform/application that already exists to do such a task
For example
List of all documents: Document #1 - Document #10
Person 1 is due for document #: 1,5,7,8
Person 2 is due for document #: 2.6
Person 3 is due for document #: 7,8,10
etc
Ideally, what I would like is for the user to be able to push a button and get a printed stack of documents that have been customized for each user including basic demographic info like name, DOB, etc
Like i said at the top, I already have all of the needed information in a database, I am just trying to figure out the best approach to move that information onto a document
I have done some research and found some people have used mail merge in Word or using Access as a front end but I don't know if this is the best way. I've also found this document. Any advice would be greatly appreciated
If I understand your problem correctly, your problem is two-fold: Firstly, you need to find a way to generated documents based on data (mail-merge) and secondly, you might need to print them two.
For document generation you have two basic approaches: template-based and programmatically from scratch. I suppose that you will opt for a template based approach which basically means that you design (in MS Word) a template document (Word, RTF, ...) that acts as a template and contains placeholders and other tags that designate »dynamic« parts of the document. Then, at document generation time, you need a .NET library/processor that you will pass this template document and the data, where the processor will populate the template with the data and return the resulting document.
One way to achieve this functionality would be employing MS Words' native mail-merge, but you should know that this would involve using Office COM and Word Application Automation which should be avoided almost always.
Another option is to build such a system on top of Open XML SDK. This is velid option, but it will be a pretty demanding task and will most probably cost you much more than buying a commercial .NET library that does mail-merge out-of-the-box – been there, done that. But of course, the good side here is that you will be able to tailer the solution to your needs. If you go down this road I recoment that you use Content Controls for tagging documents/templates. The solution with CCs will be much easier to implement than the solution with bookmarks.
I'm not very familliar with the open source solutions and I'm not sury how many there are that can do mail-merge. One I know is FlexDoc (on CodePlex) but its problem is that uses a construct (XmlControl) for tagging that is depricated in Word 2010+.
Then there are commercial solutions. Again I don't know them in detail but I know that the majority of them are a general purpose document processing libraries. Our company has been using this document generation toolkit for some time now and I can say it covers all our »template-based document generation« needs. It doesn't require MS Word at doc generation time, and has really helpful add-in for MS word and you only need several lines of code to integrate it in your project. Templating is very powerful and you can set-up a template in a very short time. While templates are Word documents, you can generate PDF or XPS docs as well. XPS is useful because you can use .NET/WPF prining framework that works with XPS docs to print documents. This is a very high-end solution, but of course, the downside here is that it is not a free solution.

AngularJs database data internationalization

I´m developing a i18n AngularJS application. I would need to display the info in english and also spanish. I´m currently using ng-translate for static content and it´s really good. But I would need to translate some info coming from database, such as the typical dropdown (select field) with country names. Depending on the user language settings, there values in the combo should be displayed in english or spanish.
I don´t know what is the best architectural approach. I mean, I think in two first approaches:
1.1 I have a table in database with the countries in just one default language (english). When I get this list to display these values are dinamically translated somehow.
1.2 I have a table in db with so many columns as languages with the countries in different languages. When I get the list I use the language settings to get the right column.
I don´t know if there is any other approach. I like 1.1. But, I´m not sure if I can implement it and how. I also would need to display these values ordered.
UPDATE
To enrich the final solution. You can have a look at next post, related to how to design a multilingual database (design pattern).
http://cleancodedevelopment-qualityseal.blogspot.com.es/2013/06/translation-multilingualmultilanguage.html
I would tend to go with 1.2, as that way you are in control of the translations. Country names probably aren't going to be much of an issue, but if there is anything more complicated, like phrases and such, then I would definitely go with 1.2, as current translation software is likely to lose nuances in translation that could be important. 1.2 would probably also make sorting slightly easier.

Plomino multilingual site

I've got Zope 2.13.15, Plone 4.2.0.1, LinguaPlone 4.1.3 and CMFPlomino 1.17.2
I need to make a multilingual website on Plone and am using Plomino. I see that I can translate plomino database, forms and views with LinguaPlone but not documents. I have seen the procedure on http://www.plomino.net/how-to/multilingual-applications (Multilingual applications - How to build a multilingual Plomino application) and more detailed on https://github.com/plomino/Plomino/issues/296. I'm not sure can I translate content of documents using this procedure because the mentioned tutorial states "If the text does not match any msgid from the i18n domain, it remains unchanged".
Does this mean that all the translations of the content of documents should be in the .po files or what. Can anybody clear this mechanism to me please and is this tutorial the right way to document content translation ?? At this moment I'm not sure if there is a document content translation solution for Plomino
What is the procedure to translate document content in Plomino? The tutorials are not clear to me.
At the moment there is no document content translation solution for Plomino.
The mentioned solution can be used to translate pre-defined contents (like labels in forms, computed values, etc.) but obviously it is not applicable to content freely entered by users in documents.
Nevertheless, Plomino is already used in multilingual contexts.
A basic solution is to:
create a field to store the document language,
provide a Document ID formula which will use this lang field value (so we can guess the id of any translated version from the current doc id),
implement the different actions you might need (like "Translate this doc", "Switch to language xx", etc.) as basic Plomino actions.

Salesforce: script to create custom object and fields

Is there a way to create custom objects and fields by using script or IDE ?
Salesforce is very easy to use, however, it's so time-consuming to create so many fields on Web interface. So, just wonder if there's ways to use script or IDE to create objects and fields in Salesforce?
You're looking for the Metadata API, or already developed tools which use the metadata api.
http://www.salesforce.com/us/developer/docs/api_meta/Content/meta_intro.htm
http://www.salesforce.com/us/developer/docs/api_meta/index.htm
Though using it directly will still require some developement, which may not save you much time. you get metadata in XML, but would still need to process it to what you want to achieve.
Somewhat also depend on the nature of what you want to do. I for instance had a requirement today for 150 custom labels based on an input file. Was much faster to generate metadata XML than to ever do that in the web interface. Deployed the metadata using the force.com IDE.

Resources