Translating Images for all languages
Is there a way to translate an image across all languages at once versus translating them one at a time?
Hello,
Retrieve the image tough the API and then change the current culture of the Thread to modify the image for each separate language, a sample is below:
LibrariesManager librariesManager = LibrariesManager.GetManager();
var image = librariesManager.GetImages().Where(i => i.Title ==
"Image"
&& i.Status==ContentLifecycleStatus.Master).FirstOrDefault();
Thread.CurrentThread.CurrentCulture =
new
CultureInfo(
"en"
);
Thread.CurrentThread.CurrentUICulture =
new
CultureInfo(
"en"
);
image.Title =
"ImageEnglish"
;
librariesManager.SaveChanges();
librariesManager.Lifecycle.Publish(image);
librariesManager.SaveChanges();
Thread.CurrentThread.CurrentCulture =
new
CultureInfo(
"fr"
);
Thread.CurrentThread.CurrentUICulture =
new
CultureInfo(
"fr"
);
image.Title =
"ImageFrench"
;
librariesManager.SaveChanges();
librariesManager.Lifecycle.Publish(image);
librariesManager.SaveChanges();