예제 #1
0
		/// --------------------------------------------------------------------------------
		/// <summary>
		///
		/// </summary>
		/// <param name="fdoCache"></param>
		/// <param name="alIDs"></param>
		/// <returns></returns>
		/// --------------------------------------------------------------------------------
		public static LgWritingSystemCollection Load(FdoCache fdoCache, Set<int> alIDs)
		{
			LgWritingSystemCollection lec = new LgWritingSystemCollection(fdoCache);
			foreach (int hvo in alIDs)
				lec.Add(new LgWritingSystem(fdoCache, hvo));
			return lec;
		}
예제 #2
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Sets the language encodings
		/// </summary>
		/// <param name="wsc"></param>
		/// ------------------------------------------------------------------------------------
		public void SetLanguageEncodings(LgWritingSystemCollection wsc)
		{
			CheckDisposed();
			m_cle = wsc;
		}
예제 #3
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Add the writing systems to the collection in the cache.
		/// </summary>
		/// ------------------------------------------------------------------------------------
		public void InitializeWritingSystemEncodings()
		{
			CheckDisposed();
			FdoCache fdoCache = Cache;
			LgWritingSystemCollection wsCollection = new LgWritingSystemCollection(fdoCache);

			// HVO  | ICU Locale | English Name | Spanish Name | French Name | IPA Name |
			// -----+------------+--------------+--------------+-------------+-----------
			// 1001 | en         | English      | inglés       |             |          |
			// 2346 | es         | Spanish      | español      | espagnol    | español  |
			// 4568 | fr         |              | francés      | francais    |          |
			// 2398 | en-ipa     | English IPA  |              |             | aipie    |
			// ???? | de         | German       |              |             | Deutsch  |
			// ???? | xkal       | Kalaba       |              |             |          |
			// ???? | ur         | Urdu         |              |             |          |

			wsCollection.Add(CreateWritingSystem(fdoCache, s_wsHvos.En,
				"en", new int[] { s_wsHvos.En, s_wsHvos.Es }, new string[] { "English", "inglés" },
				"Arial", "Times New Roman", "Charis SIL"));
			wsCollection.Add(CreateWritingSystem(fdoCache, s_wsHvos.Es,
				"es", new int[] { s_wsHvos.En, s_wsHvos.Es, s_wsHvos.Fr, s_wsHvos.Ipa },
				new string[] { "Spanish", "español", "espagnol", "español" },
				"Arial", "Times New Roman", "Charis SIL"));
			wsCollection.Add(CreateWritingSystem(fdoCache, s_wsHvos.Fr,
				"fr", new int[] { s_wsHvos.Es, s_wsHvos.Fr }, new string[] { "francés", "francais" },
				"Arial", "Times New Roman", "Charis SIL"));
			wsCollection.Add(CreateWritingSystem(fdoCache, s_wsHvos.Ipa,
				"en-IPA", new int[] { s_wsHvos.En, s_wsHvos.Ipa }, new string[] { "English IPA", "aipie" },
				null, "SILDoulos IPA93", "Charis SIL"));
			wsCollection.Add(CreateWritingSystem(fdoCache, s_wsHvos.De,
				"de", new int[] { s_wsHvos.En, s_wsHvos.Ipa }, new string[] { "German", "Deutsch" },
				"Arial", "Times New Roman", "Charis SIL"));
			wsCollection.Add(CreateWritingSystem(fdoCache, s_wsHvos.XKal,
				"xkal", new int[] { s_wsHvos.En }, new string[] { "Kalaba" },
				"Arial", "Times New Roman", "Charis SIL"));
			wsCollection.Add(CreateWritingSystem(fdoCache, s_wsHvos.Ur,
				"ur", new int[] { s_wsHvos.En }, new string[] { "Urdu" },
				"Arial Unicode MS", null, "Charis SIL"));

			((NewFdoCache)m_fdoCache).SetLanguageEncodings(wsCollection);
		}
예제 #4
0
		/// -------------------------------------------------------------------------------------
		/// <summary>
		/// Get the ws value (hvo) from the iculocale contained in the given attributes
		/// </summary>
		/// <param name="attribs">Collection of attributes that better have an "iculocale"
		/// attribute</param>
		/// <returns></returns>
		/// -------------------------------------------------------------------------------------
		private int GetWs(XmlAttributeCollection attribs)
		{
			if (m_htIcuToWs == null)
			{
				m_lgwsCollection = ResourceOwner.Cache.LanguageEncodings;
				m_htIcuToWs = new Dictionary<string, int>(1);
			}
			string iculocale = attribs.GetNamedItem("iculocale").Value;
			if (iculocale == null || iculocale == string.Empty)
				return 0;
			if (!m_htIcuToWs.ContainsKey(iculocale))
				m_htIcuToWs[iculocale] = m_lgwsCollection.GetWsFromIcuLocale(iculocale);
			return m_htIcuToWs[iculocale];
		}