Change culture of all objects after installation

97 views
Skip to first unread message

Kehan Harman

unread,
Mar 25, 2013, 4:44:11 AM3/25/13
to ica-ato...@googlegroups.com
Hi All,
We have an ICA-AtoM installation and I am trying to work out how to change the culture of all objects stored in the database as we want the dates in the system to support our current locale (en_AU) rather than the default en date formatting. Adding the language under Admin > Settings > I18n languages works but this means that all objects that have been created are now listed as 'Untitled' as they don't have an en_AU entry. My two questions are as follows:

1) Is there a way to configure ICA-AtoM to only use a single locale (ie en_AU) in our case - I have set default_culture to be en_AU apps>qubit>config>settings.yml
2) Is there a way to migrate objects from one locale to another - I experimented with a database hack that broke my system:

update accession set source_culture = 'en_AU' where source_culture = 'en';
update accession_i18n set culture = 'en_AU' where culture = 'en';
update acl_group set source_culture = 'en_AU' where source_culture = 'en';
update acl_group_i18n set culture = 'en_AU' where culture = 'en';
update actor set source_culture = 'en_AU' where source_culture = 'en';
update actor_i18n set culture = 'en_AU' where culture = 'en';
update contact_information set source_culture = 'en_AU' where source_culture = 'en';
update contact_information_i18n set culture = 'en_AU' where culture = 'en';
update deaccession set source_culture = 'en_AU' where source_culture = 'en';
update deaccession_i18n set culture = 'en_AU' where culture = 'en';
update event set source_culture = 'en_AU' where source_culture = 'en';
update event_i18n set culture = 'en_AU' where culture = 'en';
update function set source_culture = 'en_AU' where source_culture = 'en';
update function_i18n set culture = 'en_AU' where culture = 'en';
update information_object set source_culture = 'en_AU' where source_culture = 'en';
update information_object_i18n set culture = 'en_AU' where culture = 'en';
update loan set source_culture = 'en_AU' where source_culture = 'en';
update loan_i18n set culture = 'en_AU' where culture = 'en';
update menu set source_culture = 'en_AU' where source_culture = 'en';
update menu_i18n set culture = 'en_AU' where culture = 'en';
update note set source_culture = 'en_AU' where source_culture = 'en';
update note_i18n set culture = 'en_AU' where culture = 'en';
update other_name set source_culture = 'en_AU' where source_culture = 'en';
update other_name_i18n set culture = 'en_AU' where culture = 'en';
update physical_object set source_culture = 'en_AU' where source_culture = 'en';
update physical_object_i18n set culture = 'en_AU' where culture = 'en';
update property set source_culture = 'en_AU' where source_culture = 'en';
update property_i18n set culture = 'en_AU' where culture = 'en';
update relation set source_culture = 'en_AU' where source_culture = 'en';
update relation_i18n set culture = 'en_AU' where culture = 'en';
update repository set source_culture = 'en_AU' where source_culture = 'en';
update repository_i18n set culture = 'en_AU' where culture = 'en';
update rights set source_culture = 'en_AU' where source_culture = 'en';
update rights_i18n set culture = 'en_AU' where culture = 'en';
update setting set source_culture = 'en_AU' where source_culture = 'en';
update setting_i18n set culture = 'en_AU' where culture = 'en';
update static_page set source_culture = 'en_AU' where source_culture = 'en';
update static_page_i18n set culture = 'en_AU' where culture = 'en';
update taxonomy set source_culture = 'en_AU' where source_culture = 'en';
update taxonomy_i18n set culture = 'en_AU' where culture = 'en';
update term set source_culture = 'en_AU' where source_culture = 'en';
update term_i18n set culture = 'en_AU' where culture = 'en';

I obviously know the benefits of maintaining a multilingual system but we do not have the multilingual expertise to maintain lists in alternative languages and all of our users are currently Australian so expect dates to be formatted according to what they are used to.

Thanks in advance for any help.
Regards,
Kehan


Jesús García Crespo

unread,
Mar 25, 2013, 4:38:09 PM3/25/13
to ica-ato...@googlegroups.com
Hi Kehan,

On Mon, Mar 25, 2013 at 1:44 AM, Kehan Harman <kehan...@gmail.com> wrote:
We have an ICA-AtoM installation and I am trying to work out how to change the culture of all objects stored in the database as we want the dates in the system to support our current locale (en_AU) rather than the default en date formatting. Adding the language under Admin > Settings > I18n languages works but this means that all objects that have been created are now listed as 'Untitled' as they don't have an en_AU entry. My two questions are as follows:

1) Is there a way to configure ICA-AtoM to only use a single locale (ie en_AU) in our case - I have set default_culture to be en_AU apps>qubit>config>settings.yml

That's right, you can make en_AU the default culture but I don't think that you can remove English from the language list because it's still required by the core of AtoM.
 
2) Is there a way to migrate objects from one locale to another - I experimented with a database hack that broke my system:

Your set of queries would override some of the entries that AtoM uses internally.

I'm not sure how much you can change that way without breaking the app. Try with information_object and information_object_i18n first and see if it works, I think that it will. I wouldn't change the setting table, leave that one like it is. I wouldn't change the ACL tables neither, for example.

Regards,

--
Jesús García Crespo,
Software Engineer, Artefactual Systems Inc.
http://www.artefactual.com | +1.604.527.2056

Kehan Harman

unread,
Mar 25, 2013, 9:03:19 PM3/25/13
to ica-ato...@googlegroups.com
Thanks,
I will do as you suggest and will report back how it goes. I will additionally attempt to insert new i18n terms using an sql script and see how that goes.


--
You received this message because you are subscribed to the Google Groups "ICA-AtoM Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ica-atom-user...@googlegroups.com.
To post to this group, send email to ica-ato...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
kehan...@gmail.com
http://kehan.wordpress.com
skype: kehanharman
msn: kehan...@gmail.com
twitter: kehan
¸.·´¯`·.´¯`·.¸¸.·´¯`·.¸><(((º>
<º)))><,.·´¯`·.´¯`·.¸¸.·´¯`·.¸
¸.·´¯`·.´¯`·.¸¸.·´¯`·.¸><(((º>
<º)))><,.·´¯`·.´¯`·.¸¸.·´¯`·.¸
¸.·´¯`·.´¯`·.¸¸.·´¯`·.¸><(((º>
<º)))><,.·´¯`·.´¯`·.¸¸.·´¯`·.¸
¸.·´¯`·.´¯`·.¸¸.·´¯`·.¸><(((º>
<º)))><,.·´¯`·.´¯`·.¸¸.·´¯`·.¸
¸.·´¯`·.´¯`·.¸¸.·´¯`·.¸><(((º>
<º)))><,.·´¯`·.´¯`·.¸¸.·´¯`·.¸
¸.·´¯`·.´¯`·.¸¸.·´¯`·.¸><(((º>
<º)))><,.·´¯`·.´¯`·.¸¸.·´¯`·.¸
¸.·´¯`·.´¯`·.¸¸.·´¯`·.¸><(((º>
<º)))><,.·´¯`·.´¯`·.¸¸.·´¯`·.¸
¸.·´¯`·.´¯`·.¸¸.·´¯`·.¸><(((º>
<º)))><,.·´¯`·.´¯`·.¸¸.·´¯`·.¸

d...@artefactual.com

unread,
Mar 25, 2013, 10:36:32 PM3/25/13
to ica-ato...@googlegroups.com
Hi Kehnan,

Thanks for posting to the ICA-AtoM user's forum.

I see the developers have already offered you some tips that might help - let us know how it goes! In the meantime, as I was looking over your post, I noticed the following:


update loan set source_culture = 'en_AU' where source_culture = 'en';
update loan_i18n set culture = 'en_AU' where culture = 'en';

I wonder if this means that you've develop a loans module for the ICA-AtoM application?

It's an interesting development, which I am sure that many of our users would appreciate - I myself am curious to see how you've implemented it. If this is the case, I encourage you to share your source code with the community - as you may know, our application is licensed under the GNU GPL version 3 - the Free Software Foundation, who maintains this copyleft license, has a quick guide to its terms located here: http://www.gnu.org/licenses/quick-guide-gplv3.html

One of the terms of this license (5c) implies that, along with the freedom to do whatever you want with our software, we in turn expect that our users share their improvements back with the community. We use this license because we believe that the strength of open source development comes from a vibrant and collaborative community, and that many eyes are better.

If you have developed a loan module, and would like to share it, we can help you figure out the best way to do so - and doing so might benefit your own work as well. Other users interested in a loans module might return your code to you with new functionality or optimized code, for example. If there is enough interest in the community, it could be incorporated into future trunk releases of the software. In general, it demonstrates the kind of positive spirit of mutual support we hope to encourage in all our projects, and especially here in our user forum.

Thanks for considering. Let us know how the culture changes go!


Dan Gillean
AtoM Product Manager/Systems Analyst

Artefactual Systems, Inc.
www.artefactual.com


Kehan Harman

unread,
Mar 25, 2013, 11:25:14 PM3/25/13
to ica-atom-users
Hi All,

Firstly Dan,

It is fully our intention to contribute the loan system back to ICA-AtoM. We have essentially taken the accession system and copied it for loans and then customised it for our local workflows.  We are in a difficult situation as we started our work on implementing it about 50 revisions before you moved from google code to github and I only discovered your github repository about a month ago. The system is however currently far from complete at the moment. What would be the 'normal' way to contirbute the loan system back? 

And then I have had some luck in setting up the en_AU locale.

I used the following statement to create my update queries:
Which resulted in the following sql which I then ran:

This seemed to work but be warned - this script removes any i18n translations for cultures other than 'en' and then creates new i18n translations.

I obviously don't like this database hacking but his is an already running system that needed these changes implemented.

Regards,
Kehan



--
You received this message because you are subscribed to the Google Groups "ICA-AtoM Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ica-atom-user...@googlegroups.com.
To post to this group, send email to ica-ato...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/ica-atom-users/-/BDmQgXKhGLYJ.

For more options, visit https://groups.google.com/groups/opt_out.
 
 

Jesús García Crespo

unread,
Mar 25, 2013, 11:48:14 PM3/25/13
to ica-ato...@googlegroups.com
On Mon, Mar 25, 2013 at 8:25 PM, Kehan Harman <kehan...@gmail.com> wrote:
What would be the 'normal' way to contirbute the loan system back? 

Whatever it works. A git repo that we can access, a patch formatted with git-format-patch, etc... we've never received pull requests but I wouldn't mind neither.

d...@artefactual.com

unread,
Mar 26, 2013, 2:07:19 PM3/26/13
to ica-ato...@googlegroups.com
Hi Kehan,

Thanks for your quick reply. I'm glad to hear you've made progress! Thanks for sharing the script and its accompanying warning  - we get a lot of questions about culture changes in AtoM, and the solutions are not always pretty, but it's always impressive to see the ways our community manages to bend the software code to create the functionality they need.

We do have one feature request ticket open, that is not currently slated for development (as it has no funding at the moment), to be able to add new languages and cultures easily to the .DAT file that contains the i18n cultures - there is a simple script attached to accomplish this, prepared by Jesus, but the hope would be to create a GUI that would allow changes in culture to be handled more easily by our users. While this is not exactly what you have been trying to accomplish, it is the kind of workflow we would want to consider if this feature ever gets support for development. See the ticket here: https://projects.artefactual.com/issues/3988

I'm so glad to hear that you intend to share your code when it is ready! We appreciate the way that our community interacts with the project, and are always happy to see new modifications and derivs out in the wild, especially when it can benefit and inspire other users. Thank you for being an active participant, and we look forward to seeing what you've come up with. I'm sorry that our repo move affected you mid-project - we tried to get the word out to our community, and you'll find a post about the move pinned to the top of this discussion list, but moving is always a complicated process when we have such a diverse user base. We feel that Github is a much better home for our code though, and have been happy with the move.

As Jesus has already mentioned, we are open to a wide variety of shares, but we generally encourage our users to fork or clone our repository rather than sending a pull request, and the easiest way to share with us directly is through a git-formatted patch. You will some guidelines we've established here: https://www.qubit-toolkit.org/wiki/Contribute_code

We've got a simple contributor's agreement form on the page, as well as a brief explanation of why we encourage our users to sign it if they would like to contribute code. We also try to maintain a list of contributors here: https://www.qubit-toolkit.org/wiki/Contributors

Thanks again for sharing, and keep us updated on how your database hacks go. If you run into any further issues, you may also be interested in our Developer's User forum, located here: https://groups.google.com/forum/?fromgroups=#!forum/qubit-dev

Our developers try to monitor and respond to this list for more technical questions, and you will be more likely to find community users with development experience, similar questions, and useful perspectives on matters of code.

Best of luck!

d...@artefactual.com

unread,
Apr 1, 2013, 4:51:42 PM4/1/13
to ica-ato...@googlegroups.com, d...@artefactual.com
Hello again Kehan,


Just a quick update for you, and for any other users following this discussion:


After discussing with our developers, we've clarified our contributor's policy in a few ways. First, we will in fact accept pull requests from our repository - in fact, the patch you recently submitted was our first pull request, so thank you! We've updated our documentation to reflect this change in pull requests. In addition, we have added a CONTRIBUTING.md file to the Artefactual AtoM repository on Github - now our contribution information will be included with the application, and can be viewed on Github as well. We're hoping this will help future users locate contribution information more easily. Thanks for the motivation!

As for the pull request, I have tested the issue you identified, and like Jesus, was able to recreate the issue on our demo site. To ensure we're keeping up with documentation, I opened a ticket in our AtoM issues list, and then tested the patch you submitted in our development branch. It worked without any problems - thanks again for finding this issue and submitting a fix for it! You can see the AtoM issue (now closed as "verified") here: https://projects.artefactual.com/issues/4869

As I am sure you've noticed, Jesus has accepted your pull request, but he forgot to ensure that you signed the contributor's agreement before doing so - could you please complete the form and return it to us? Here's a direct link to the form: https://www.qubit-toolkit.org/accesstomemory-contributor-agreement.pdf  (PDF). Once you've filled out the form, we will add your name to the AtoM Contributors page!

Thanks again for contributing to the AtoM community - keep us posted on how your work with the loan module goes, and let us know if you run into any other problems, either here or on the Developer's forum.

Best,

Kehan Harman

unread,
Apr 1, 2013, 10:25:39 PM4/1/13
to ica-atom-users
Hi Dan,

Jesús had already asked me to get the agreement signed, and I was just waiting to get back to work in order to do that. I have signed the agreement and forwarded it on to the address provided in the documentation. Thanks for adjusting your procedures to include GitHub pull requests as they neatly combine the issue with the code contributed. I think it is good that open source project is protected by these kind of agreements.
Regards,
Kehan


--
You received this message because you are subscribed to the Google Groups "ICA-AtoM Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ica-atom-user...@googlegroups.com.
To post to this group, send email to ica-ato...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/ica-atom-users/-/8bqsKOwsPvEJ.

For more options, visit https://groups.google.com/groups/opt_out.
 
 
Reply all
Reply to author
Forward
0 new messages