-
Notifications
You must be signed in to change notification settings - Fork 421
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5276 from peppy/localisation-mass-language-add
Allow initial locale mappings to be added in a single call
- Loading branch information
Showing
3 changed files
with
81 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. | ||
// See the LICENCE file in the repository root for full licence text. | ||
|
||
namespace osu.Framework.Localisation | ||
{ | ||
/// <summary> | ||
/// Maps a localisation store to a lookup string. | ||
/// Used by <see cref="LocalisationManager"/>. | ||
/// </summary> | ||
public class LocaleMapping | ||
{ | ||
public readonly string Name; | ||
public readonly ILocalisationStore Storage; | ||
|
||
/// <summary> | ||
/// Create a locale mapping from a localisation store. | ||
/// </summary> | ||
/// <param name="store">The store to be used.</param> | ||
public LocaleMapping(ILocalisationStore store) | ||
{ | ||
Name = store.EffectiveCulture.Name; | ||
Storage = store; | ||
} | ||
|
||
/// <summary> | ||
/// Create a locale mapping with a custom lookup name. | ||
/// </summary> | ||
/// <param name="name"></param> | ||
/// <param name="store">The store to be used.</param> | ||
public LocaleMapping(string name, ILocalisationStore store) | ||
{ | ||
Name = name; | ||
Storage = store; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters