Developer forum

Forum » CMS - Standard features » Shared Translations

Shared Translations

Aki Ruuskanen
Aki Ruuskanen
Reply

Hi,

I cannot see that it is possible to create translations keys in the "Shared" directly from the templates.

Is that so or am I missing something?

Regards / Aki


Replies

 
Nicolai Pedersen
Reply

Meaning that the key will create them selfes in the shared file?

 
Aki Ruuskanen
Aki Ruuskanen
Reply

Sorry for a little vague description. :)

I mean when you use the @Translate("My string") tag. 

Is it possible to get that translate key into the "Shared" section in Translation intead of the current designs (In this case "Rapido").

Regards / Aki

translation.png
 
Nicolai Pedersen
Reply

Hi Aki

I do not thnink that is possible. Just looking at the API and the code...

BR Nicolai

 
Aki Ruuskanen
Aki Ruuskanen
Reply

Alright. Thanks anyway.

Back in the day you could do something like this  <!--@Translate(mykey, "Stuff", global)-->

In a Rapido enviroment I would like have have my custom translations separated from the Rapido translations. 

/Aki

 
Aki Ruuskanen
Aki Ruuskanen
Reply

Would there perhaps be some Ninja tricks hidden in the API to able to separate Rapido translations from other translations? smiley

Regards / Aki

 

 
Nicolai Pedersen
Reply

You might be able to have some fun using the Dynamicweb.Rendering.Translation.Translation class.

 
Aki Ruuskanen
Aki Ruuskanen
Reply

Alright. I'll check it out. Thanks. 

/Aki

 
Aki Ruuskanen
Aki Ruuskanen
Reply

I saw that in Dynamicweb.dll 9.9 there is a Translation.GetTranslation(String, CultureInfo, KeyScope, Design). Looks like it's what I am looking for. 

https://doc.dynamicweb.com/api/html/c4e5ee91-1169-fb71-193e-5bda11da47c3.htm

Nicolai, is there any possibility the get a hold of that DLL. It's for a project that wont be released until after DW 9.9 but I would be nice to able to work on that before the 9.9 release.

Regards / Aki

 
Nicolai Pedersen
Reply

You have to wait. The dynamicweb.dll source code has been converted from vb to c# and this change cannot be merged - as it is also having other dependencies.

 
Aki Ruuskanen
Aki Ruuskanen
Reply

Works fine!

 

        public static string GetTranslationFromDesign(string key, string designPath)
        {
            var pathToTranslation = HttpContext.Current.Server.MapPath(designPath);
            var design = new Dynamicweb.Rendering.Designer.Design(new DirectoryInfo(pathToTranslation));
            return Dynamicweb.Rendering.Translation.Translation.GetTranslation(key, design);
        }

 

You must be logged in to post in the forum