예제 #1
0
파일: Localize.cs 프로젝트: PavelPZ/REW
 /// <summary>
 /// Prevod nelokalizovaneho seznamu LMLiteral, Img, Trans a LMScormObj objektu na lokalizovane LMLiterals
 /// </summary>
 static IEnumerable<LMScormObj> localizeObjectList(object[] objs, StringBuilder buf, ResxFilesManager resx) {
   resx.Clear();
   if (objs == null || objs.Length == 0) yield break;
   foreach (LMScormObj item in objs) {
     if (item is LMLiteral)
       resx.append(((LMLiteral)item).text);
     else if (item is img)
       resx.append((img)item);
     else if (item is trans) {
       string txt;
       if (tryTransText((trans)item, out txt))
         resx.append(item.varName, null, txt);
     } else {
       if (!resx.isEmpty()) {
         yield return resx.toLocalizedLiteral();
         resx.Clear();
       }
       yield return item;
     }
   }
   if (!resx.isEmpty())
     yield return resx.toLocalizedLiteral();
 }