Last week I had to export dictionary items from my local dev to the staging and production servers, first I did it with SQL Scripts, but the doctionary broke because of these scripts :-/
So I did it with a package and including all dictionary items and manually removed the unnecessary items, which sucks :P
Wouldn't it be great if that export could be formatted in a resx schema, that way it can be opened with Zeta and translations can be handled from there
afterwards imported back again.
i know what i'm saying does not really import dictionary items itself, its meant more exporting the translations, and importing them back again after sending them via the translator service / client / google translate...
but its still nice to keep in mind when import / export is beeing programmed, be it core or package, making this possible would be a nice addition.
exporting/importing dictionary items
I was just wondering, am I the only one or should it be handy to be able to export DictionaryItems?
After all the dictionary items are stored in just 2 table (cmsDictionary / cmsLanguageText)
Should someting like this make it to the core?
Should we make a package for it? Like @aim24 said, a package.xml will do.
Yes that would be nice!
Last week I had to export dictionary items from my local dev to the staging and production servers, first I did it with SQL Scripts, but the doctionary broke because of these scripts :-/
So I did it with a package and including all dictionary items and manually removed the unnecessary items, which sucks :P
Here is some kind of solution using /base, however direct integration to backend dictionary UI would be awesome ;)
[RestExtensionMethod] public static void exportDictionary(int itemId) { XmlDocument doc = new XmlDocument(); Dictionary.DictionaryItem item = new Dictionary.DictionaryItem(itemId); //Set the item id, check it in the dictionary System.Web.HttpResponse hr = System.Web.HttpContext.Current.Response; XmlNode node = item.ToXml(doc); hr.Clear(); hr.ContentEncoding = new System.Text.UTF32Encoding(); hr.AddHeader("content-disposition", "attachment; filename=ditems.xml"); hr.ContentType = "application/xml"; hr.Write(node.OuterXml); hr.End(); } [RestExtensionMethod] public static void importDictionary() { XmlDocument doc = new XmlDocument(); String path = HttpContext.Current.Server.MapPath("App_Data/xml/ditems.xml"); //Upload a file somewhere to reachable place FileStream stream = new FileStream(path, FileMode.Open); XmlReader r = XmlReader.Create(stream); doc.Load(r); XmlNode root = doc.SelectSingleNode("/DictionaryItem"); Dictionary.DictionaryItem.Import(root); }Please share the improvements or ideas!
/Julius Bartkus
A client of mine is using Direct DB scripts as well. This shouldn't break. @kipusoep Have you done an IISReset when you ran the script?
Cheers,
Richard
Yes I did, probably a fault of my own ;-)
for translations in not umbraco projects,
resource files are used, and these can be managed with existing tools like Zeta
http://www.zeta-resource-editor.com/index.html
Wouldn't it be great if that export could be formatted in a resx schema,
that way it can be opened with Zeta and translations can be handled from there
afterwards imported back again.
i know what i'm saying does not really import dictionary items itself, its meant more exporting the translations, and importing them back again after sending them via the translator service / client / google translate...
but its still nice to keep in mind when import / export is beeing programmed, be it core or package, making this possible would be a nice addition.
I have created a package for this which allows you to export dictionary items, import dictionary items and also update languageText.
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.