https://discord.umbraco.com logo
Does anyone know if it possible in
# umbraco-chat
b
Does anyone know if it possible in Umbraco to import non-exisiting dictionary items? I can import dictionary items that already exist, but that is not what I want. I have 200+ items that needs to be added, and I do not want to do that manually
s
Yes you can do this with the
IDictionaryService
I think that works in both v17 and v13
b
Thank you Sebastiaan!
m
or [uSync ](https://marketplace.umbraco.com/package/usync) it.. generate a few dictionary.config files instead and save yourself the SCRUD!
Copy code
xml
<?xml version="1.0" encoding="utf-8"?>
<Dictionary Key="db875bf8-5b22-48ab-ba69-6682c3b7e45a" Alias="Search.Results" Level="0">
  <Info />
  <Translations>
    <Translation Language="en-US"><p>We found <strong>{0}</strong> results when searching for <strong>{1}</strong></p></Translation>
  </Translations>
</Dictionary>
Also https://marketplace.umbraco.com/package/cmsimport supports dictionary imports.. though not sure if it's a paid feature.
You can download the free version of CMSImport which is limited to import 500 records and limited in functionality.
b
Thanks for tips! My case is I get xx properties from an external system at multiple points in the future, which I do not know. These need to be translated with a dictionary. So it will be in a production environment that the dictionary items need to be created and then automated translated with the translationManager
m
That for sure complicates things.. as you'll be synching from that external store, and needing to decide what to do if items in the external store change. (as not sure you will have a mapping that will get you to an update over just seeing it as a new entry. unless you had a UID in the external store that you could translate to the dictionary key(guid) or a keyname identifier.... ) also deletes in the external store to consider? But maybe that's overcomplicating things.. 😉
b
Thanks! sometrhing to think about during the weekend 😉
m
🙁 Bank Holiday Monday in the UK.. so some downtime for me.. hopefully you too.
b
Have a extra nice weekend then! 🙂
3 Views