예제 #1
0
        private static string GetSection(PoItem item)
        {
            string section = "";

            /// msgid
            section += string.Format("msgid \"{0}\"", PoFieldString(item.MsgId));

            /// new line
            section += "\n";

            /// msgstr
            var lines = item.MsgStr.Split('\n').ToList();
            if (lines.Count == 1)
            {
                section += string.Format("msgstr \"{0}\"", PoFieldString(lines[0]));
            }
            else
            {
                section += string.Format("msgstr \"\"");
                foreach (var line in lines)
                {
                    section += string.Format("\n\"{0}\"", PoFieldString(line));
                }
            }

            return section;
        }
예제 #2
0
        private static string GetSection(PoItem item)
        {
            string section = "";

            /// msgid
            section += string.Format("msgid \"{0}\"", PoFieldString(item.MsgId));

            /// new line
            section += "\n";

            /// msgstr
            var lines = item.MsgStr.Split('\n').ToList();

            if (lines.Count == 1)
            {
                section += string.Format("msgstr \"{0}\"", PoFieldString(lines[0]));
            }
            else
            {
                section += string.Format("msgstr \"\"");
                foreach (var line in lines)
                {
                    section += string.Format("\n\"{0}\"", PoFieldString(line));
                }
            }

            return(section);
        }