Mercurial > repos > IBBoard
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 |
rev | line source |
---|---|
69 | 1 // This file (TranslationSet.cs) is a part of the IBBoard project and is copyright 2010 IBBoard |
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 | 4 |
5 using System; | |
6 using System.Collections.Generic; | |
7 | |
8 namespace IBBoard.Lang | |
9 { | |
10 /// <summary> | |
11 /// A set of translations in a given language that allow setting of translations as well as getting | |
12 /// </summary> | |
13 public class ModifiableTranslationSet : AbstractTranslationSet | |
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 | 18 { |
19 //Do nothing extra | |
20 } | |
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 | 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 | 37 } |
38 } |