Multilanguage files, get All versions(each language) of a si

Posted by hugo.aguirre@bray.com on 28-Jan-2020 23:11

I have a site with multilanguage.

In documents and files I added files with their corresponding version in each language.

I want to get all versions of the selected document.

I did this:

public void GetDocumentLanguageVersions(IEnumerable<Guid> documentsId)
{

      var librariesManager = LibrariesManager.GetManager();
      List<Document> documents = librariesManager.GetDocuments().Where(document =>documentsId.Contains(document.Id)).ToList();  
      Document proof = documents.FirstOrDefault();
      string[] languages = proof.AvailableLanguages;
      var languageData = proof.LanguageData;  //In this object I can see the number of languages ​​available for this document but it does not show me the ids

}

Thanks in advanced.

All Replies

Posted by jread on 31-Jan-2020 17:10

On the attached gist you can get at the Urls of the items my access the Lstring fields using an indexer culture.  This is an extension method so usage looks like below:

LibrariesManager manager = LibrariesManager.GetManager();
			var document = manager.GetDocuments().FirstOrDefault(doc => doc.Status == ContentLifecycleStatus.Live && doc.Visible);

			var langUrls = document.GetLanguageUrls();

[View:https://gist.github.com/jonathanread/07ae66b1566cb0df5c7bd4640e999446:550:50]

Posted by hugo.aguirre@bray.com on 31-Jan-2020 18:18

Thanks a lot bro!

Posted by jread on 31-Jan-2020 18:35

Also check out this documentation for getting the data a little different way.  www.progress.com/.../for-developers-query-localized-items

This thread is closed