|
1 | 1 | // Copyright (c) .NET Foundation and Contributors (https://dotnetfoundation.org/ & https://stride3d.net) and Silicon Studio Corp. (https://www.siliconstudio.co.jp) |
2 | 2 | // Distributed under the MIT license. See the LICENSE.md file in the project root for more information. |
3 | | -using System; |
| 3 | + |
4 | 4 | using System.Globalization; |
5 | 5 | using System.Reflection; |
6 | | -using Stride.Core.Annotations; |
7 | 6 |
|
8 | | -namespace Stride.Core.Translation |
| 7 | +namespace Stride.Core.Translation; |
| 8 | + |
| 9 | +public interface ITranslationManager : ITranslationProvider |
9 | 10 | { |
10 | | - public interface ITranslationManager : ITranslationProvider |
11 | | - { |
12 | | - /// <summary> |
13 | | - /// Gets or sets the current culture used by this Translation Manager to look up culture-specific resources at run time. |
14 | | - /// </summary> |
15 | | - [NotNull] |
16 | | - CultureInfo CurrentLanguage { get; set; } |
| 11 | + /// <summary> |
| 12 | + /// Gets or sets the current culture used by this Translation Manager to look up culture-specific resources at run time. |
| 13 | + /// </summary> |
| 14 | + CultureInfo CurrentLanguage { get; set; } |
17 | 15 |
|
18 | | - event EventHandler LanguageChanged; |
| 16 | + event EventHandler LanguageChanged; |
19 | 17 |
|
20 | | - /// <summary> |
21 | | - /// Gets the translation of <paramref name="text"/> in the current culture. |
22 | | - /// </summary> |
23 | | - /// <param name="text">The text to translate.</param> |
24 | | - /// <param name="assembly">The main assembly to lookup the translation.</param> |
25 | | - /// <returns>The translation of <paramref name="text"/> in the current culture; or <paramref name="text"/> if no translation is found.</returns> |
26 | | - [NotNull] |
27 | | - string GetString([NotNull] string text, [NotNull] Assembly assembly); |
| 18 | + /// <summary> |
| 19 | + /// Gets the translation of <paramref name="text"/> in the current culture. |
| 20 | + /// </summary> |
| 21 | + /// <param name="text">The text to translate.</param> |
| 22 | + /// <param name="assembly">The main assembly to lookup the translation.</param> |
| 23 | + /// <returns>The translation of <paramref name="text"/> in the current culture; or <paramref name="text"/> if no translation is found.</returns> |
| 24 | + string GetString(string text, Assembly assembly); |
28 | 25 |
|
29 | | - /// <summary> |
30 | | - /// Gets the translation of <paramref name="text"/> and/or <paramref name="textPlural"/> in the current culture, |
31 | | - /// choosing the right plural form depending on the <paramref name="count"/>. |
32 | | - /// </summary> |
33 | | - /// <param name="text">The text to translate.</param> |
34 | | - /// <param name="textPlural">The plural version of the text to translate.</param> |
35 | | - /// <param name="count">An integer used to determine the plural form.</param> |
36 | | - /// <param name="assembly">The main assembly to lookup the translation.</param> |
37 | | - /// <returns>The translation of <paramref name="text"/> in the current culture; or <paramref name="text"/> if no translation is found.</returns> |
38 | | - [NotNull] |
39 | | - string GetPluralString([NotNull] string text, string textPlural, long count, [NotNull] Assembly assembly); |
| 26 | + /// <summary> |
| 27 | + /// Gets the translation of <paramref name="text"/> and/or <paramref name="textPlural"/> in the current culture, |
| 28 | + /// choosing the right plural form depending on the <paramref name="count"/>. |
| 29 | + /// </summary> |
| 30 | + /// <param name="text">The text to translate.</param> |
| 31 | + /// <param name="textPlural">The plural version of the text to translate.</param> |
| 32 | + /// <param name="count">An integer used to determine the plural form.</param> |
| 33 | + /// <param name="assembly">The main assembly to lookup the translation.</param> |
| 34 | + /// <returns>The translation of <paramref name="text"/> in the current culture; or <paramref name="text"/> if no translation is found.</returns> |
| 35 | + string GetPluralString(string text, string textPlural, long count, Assembly assembly); |
40 | 36 |
|
41 | | - /// <summary> |
42 | | - /// Gets the translation of <paramref name="text"/> in the provided <paramref name="context"/> in the current culture. |
43 | | - /// </summary> |
44 | | - /// <param name="context">The particular context for the translation.</param> |
45 | | - /// <param name="text">The text to translate.</param> |
46 | | - /// <param name="assembly">The main assembly to lookup the translation.</param> |
47 | | - /// <returns>The translation of <paramref name="text"/> in the current culture; or <paramref name="text"/> if no translation is found.</returns> |
48 | | - [NotNull] |
49 | | - string GetParticularString(string context, [NotNull] string text, [NotNull] Assembly assembly); |
| 37 | + /// <summary> |
| 38 | + /// Gets the translation of <paramref name="text"/> in the provided <paramref name="context"/> in the current culture. |
| 39 | + /// </summary> |
| 40 | + /// <param name="context">The particular context for the translation.</param> |
| 41 | + /// <param name="text">The text to translate.</param> |
| 42 | + /// <param name="assembly">The main assembly to lookup the translation.</param> |
| 43 | + /// <returns>The translation of <paramref name="text"/> in the current culture; or <paramref name="text"/> if no translation is found.</returns> |
| 44 | + string GetParticularString(string context, string text, Assembly assembly); |
50 | 45 |
|
51 | | - /// <summary> |
52 | | - /// Gets the translation of <paramref name="text"/> and/or <paramref name="textPlural"/> in the provided <paramref name="context"/> in the current culture, |
53 | | - /// choosing the right plural form depending on the <paramref name="count"/>. |
54 | | - /// </summary> |
55 | | - /// <param name="context">The particular context for the translation.</param> |
56 | | - /// <param name="text">The text to translate.</param> |
57 | | - /// <param name="textPlural">The plural version of the text to translate.</param> |
58 | | - /// <param name="count">An integer used to determine the plural form.</param> |
59 | | - /// <param name="assembly">The main assembly to lookup the translation.</param> |
60 | | - /// <returns>The translation of <paramref name="text"/> in the current culture; or <paramref name="text"/> if no translation is found.</returns> |
61 | | - [NotNull] |
62 | | - string GetParticularPluralString(string context, [NotNull] string text, string textPlural, long count, [NotNull] Assembly assembly); |
| 46 | + /// <summary> |
| 47 | + /// Gets the translation of <paramref name="text"/> and/or <paramref name="textPlural"/> in the provided <paramref name="context"/> in the current culture, |
| 48 | + /// choosing the right plural form depending on the <paramref name="count"/>. |
| 49 | + /// </summary> |
| 50 | + /// <param name="context">The particular context for the translation.</param> |
| 51 | + /// <param name="text">The text to translate.</param> |
| 52 | + /// <param name="textPlural">The plural version of the text to translate.</param> |
| 53 | + /// <param name="count">An integer used to determine the plural form.</param> |
| 54 | + /// <param name="assembly">The main assembly to lookup the translation.</param> |
| 55 | + /// <returns>The translation of <paramref name="text"/> in the current culture; or <paramref name="text"/> if no translation is found.</returns> |
| 56 | + string GetParticularPluralString(string context, string text, string textPlural, long count, Assembly assembly); |
63 | 57 |
|
64 | | - void RegisterProvider([NotNull] ITranslationProvider provider); |
65 | | - } |
| 58 | + void RegisterProvider(ITranslationProvider provider); |
66 | 59 | } |
0 commit comments