annotate Lang/ModifiableTranslationSet.cs @ 109:93081f4df6b8

* Add standardised .hgignore for C# projects
author IBBoard <dev@ibboard.co.uk>
date Sat, 24 Sep 2011 11:57:54 +0100
parents 90b9a3fe3c18
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
69
b5d7e8b93205 Re #30: Improve Translations API
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1 // This file (TranslationSet.cs) is a part of the IBBoard project and is copyright 2010 IBBoard
b5d7e8b93205 Re #30: Improve Translations API
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
2 //
87
90b9a3fe3c18 * Correct licensing comments at top of files
IBBoard <dev@ibboard.co.uk>
parents: 76
diff changeset
3 // The file and the library/program it is in are licensed and distributed, without warranty, under the GNU LGPL, either version 3 of the License or (at your option) any later version. Please see COPYING for more information and the full license.
69
b5d7e8b93205 Re #30: Improve Translations API
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
4
b5d7e8b93205 Re #30: Improve Translations API
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
5 using System;
b5d7e8b93205 Re #30: Improve Translations API
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
6 using System.Collections.Generic;
b5d7e8b93205 Re #30: Improve Translations API
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
7
b5d7e8b93205 Re #30: Improve Translations API
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
8 namespace IBBoard.Lang
b5d7e8b93205 Re #30: Improve Translations API
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
9 {
b5d7e8b93205 Re #30: Improve Translations API
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
10 /// <summary>
b5d7e8b93205 Re #30: Improve Translations API
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
11 /// A set of translations in a given language that allow setting of translations as well as getting
b5d7e8b93205 Re #30: Improve Translations API
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
12 /// </summary>
b5d7e8b93205 Re #30: Improve Translations API
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
13 public class ModifiableTranslationSet : AbstractTranslationSet
b5d7e8b93205 Re #30: Improve Translations API
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
14 {
75
b1ae6fce2e3f Re #35: Add multi-level cascading of translations
IBBoard <dev@ibboard.co.uk>
parents: 70
diff changeset
15 private AbstractTranslationSet parentTranslationSet;
b1ae6fce2e3f Re #35: Add multi-level cascading of translations
IBBoard <dev@ibboard.co.uk>
parents: 70
diff changeset
16
76
f45d28dc1d6a Re #35: Add multi-level cascading of translations
IBBoard <dev@ibboard.co.uk>
parents: 75
diff changeset
17 public ModifiableTranslationSet(string languageCode) : base(languageCode)
69
b5d7e8b93205 Re #30: Improve Translations API
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
18 {
b5d7e8b93205 Re #30: Improve Translations API
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
19 //Do nothing extra
b5d7e8b93205 Re #30: Improve Translations API
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
20 }
b5d7e8b93205 Re #30: Improve Translations API
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
21
70
753be4b6c3b0 Re #31: Break out Translations for language to own class
IBBoard <dev@ibboard.co.uk>
parents: 69
diff changeset
22 public void SetTranslation(string key, string translation)
69
b5d7e8b93205 Re #30: Improve Translations API
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
23 {
70
753be4b6c3b0 Re #31: Break out Translations for language to own class
IBBoard <dev@ibboard.co.uk>
parents: 69
diff changeset
24 translations[key] = translation;
753be4b6c3b0 Re #31: Break out Translations for language to own class
IBBoard <dev@ibboard.co.uk>
parents: 69
diff changeset
25 }
75
b1ae6fce2e3f Re #35: Add multi-level cascading of translations
IBBoard <dev@ibboard.co.uk>
parents: 70
diff changeset
26
b1ae6fce2e3f Re #35: Add multi-level cascading of translations
IBBoard <dev@ibboard.co.uk>
parents: 70
diff changeset
27 public void SetParentTranslations(ModifiableTranslationSet parentTranslations)
b1ae6fce2e3f Re #35: Add multi-level cascading of translations
IBBoard <dev@ibboard.co.uk>
parents: 70
diff changeset
28 {
b1ae6fce2e3f Re #35: Add multi-level cascading of translations
IBBoard <dev@ibboard.co.uk>
parents: 70
diff changeset
29 parentTranslationSet = parentTranslations;
b1ae6fce2e3f Re #35: Add multi-level cascading of translations
IBBoard <dev@ibboard.co.uk>
parents: 70
diff changeset
30 }
b1ae6fce2e3f Re #35: Add multi-level cascading of translations
IBBoard <dev@ibboard.co.uk>
parents: 70
diff changeset
31
b1ae6fce2e3f Re #35: Add multi-level cascading of translations
IBBoard <dev@ibboard.co.uk>
parents: 70
diff changeset
32 protected override AbstractTranslationSet GetParentTranslations()
b1ae6fce2e3f Re #35: Add multi-level cascading of translations
IBBoard <dev@ibboard.co.uk>
parents: 70
diff changeset
33 {
b1ae6fce2e3f Re #35: Add multi-level cascading of translations
IBBoard <dev@ibboard.co.uk>
parents: 70
diff changeset
34 return parentTranslationSet;
b1ae6fce2e3f Re #35: Add multi-level cascading of translations
IBBoard <dev@ibboard.co.uk>
parents: 70
diff changeset
35 }
b1ae6fce2e3f Re #35: Add multi-level cascading of translations
IBBoard <dev@ibboard.co.uk>
parents: 70
diff changeset
36
69
b5d7e8b93205 Re #30: Improve Translations API
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
37 }
b5d7e8b93205 Re #30: Improve Translations API
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
38 }