annotate Lang/ModifiableTranslationSet.cs @ 73:091bfa54d6c7

Re #33: Add method to get list of available translations * Add "translation language" object to pair up code and name * Load all translations at initialisation time Also: * Remove rogue "set" property on abstract translation set
author IBBoard <dev@ibboard.co.uk>
date Tue, 06 Apr 2010 18:58:30 +0000
parents 753be4b6c3b0
children b1ae6fce2e3f
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 //
b5d7e8b93205 Re #30: Improve Translations API
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
3 // The file and the library/program it is in are licensed and distributed, without warranty, under the GNU Affero GPL license, either version 3 of the License or (at your option) any later version. Please see COPYING for more information and the full license.
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 {
b5d7e8b93205 Re #30: Improve Translations API
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
15 public ModifiableTranslationSet(string languageCode) : base(languageCode)
b5d7e8b93205 Re #30: Improve Translations API
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
16 {
b5d7e8b93205 Re #30: Improve Translations API
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
17 //Do nothing extra
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
70
753be4b6c3b0 Re #31: Break out Translations for language to own class
IBBoard <dev@ibboard.co.uk>
parents: 69
diff changeset
20 public void SetTranslation(string key, string translation)
69
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 translations[key] = translation;
753be4b6c3b0 Re #31: Break out Translations for language to own class
IBBoard <dev@ibboard.co.uk>
parents: 69
diff changeset
23 }
69
b5d7e8b93205 Re #30: Improve Translations API
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
24 }
b5d7e8b93205 Re #30: Improve Translations API
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
25 }