Skip to content

Commit 58714dc

Browse files
committed
Initial commit.
0 parents  commit 58714dc

17 files changed

+1023
-0
lines changed

.editorconfig

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
; Grab the EditorConfig extension for Visual Studio:
2+
; https://visualstudiogallery.msdn.microsoft.com/c8bccfe2-650c-4b42-bc5c-845e21f96328
3+
4+
; Top-most EditorConfig file
5+
root = true
6+
7+
; Unix-style newlines with a newline ending every file
8+
[*]
9+
end_of_line = LF
10+
insert_final_newline = true
11+
indent_style = space
12+
indent_size = 4
13+
trim_trailing_whitespace = true
14+
15+
[*.{md,yaml}]
16+
trim_trailing_whitespace = false
17+
18+
[*.{js,json,yaml,html,css,styl}]
19+
indent_size = 2
20+
21+
[Makefile]
22+
indent_style = tab

.gitattributes

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
# Apply native OS line-endings on checkout of these files...
2+
*.boo text
3+
*.c text
4+
*.cginc text
5+
*.config text
6+
*.contentproj text
7+
*.cpp text
8+
*.cs text
9+
*.css text
10+
*.dae text
11+
*.DAE text
12+
*.dtd text
13+
*.fx text
14+
*.glsl text
15+
*.h text
16+
*.htm text
17+
*.html text
18+
*.inc text
19+
*.ini text
20+
*.js text
21+
*.JSFL text
22+
*.jsfl text
23+
*.json text
24+
*.log text
25+
*.md text
26+
*.mel text
27+
*.php text
28+
*.po text
29+
*.shader text
30+
*.txt text
31+
*.TXT text
32+
*.xaml text
33+
*.xml text
34+
*.xsd text
35+
.gitattributes text
36+
.gitignore text
37+
COPYING text
38+
INSTALL* text
39+
KEYS* text
40+
LICENSE* text
41+
NEWS* text
42+
NOTICE* text
43+
README* text
44+
TODO* text
45+
WHATSNEW* text
46+
47+
# Apply Unix-style LF line-endings on checkout for these files since Unity
48+
# project has been configured to force text output for them...
49+
*.anim text eol=lf
50+
*.asset text eol=lf
51+
*.controller text eol=lf
52+
*.cubemap text eol=lf
53+
*.guiskin text eol=lf
54+
*.mat text eol=lf
55+
*.prefab text eol=lf
56+
*.physicMaterial text eol=lf
57+
*.physicmaterial text eol=lf
58+
*.unity text eol=lf
59+
60+
# Apply Unix-style LF line-endings on checkout of these files...
61+
*.meta text eol=lf
62+
*.sh text eol=lf
63+
*.vspscc text eol=lf
64+
.htaccess text eol=lf
65+
66+
# Apply Windows/DOS-style CR-LF line-endings on checkout of these files...
67+
*.bat text eol=crlf
68+
*.cmd text eol=crlf
69+
*.csproj text eol=crlf
70+
*.sln text eol=crlf
71+
*.user text eol=crlf
72+
*.vcproj text eol=crlf
73+
74+
# No end-of-line conversions are applied (i.e., "-text -diff") to these files...
75+
*.7z binary
76+
*.ai binary
77+
*.apk binary
78+
*.bin binary
79+
*.bmp binary
80+
*.BMP binary
81+
*.com binary
82+
*.COM binary
83+
*.dex binary
84+
*.dll binary
85+
*.DLL binary
86+
*.dylib binary
87+
*.eps binary
88+
*.exe binary
89+
*.EXE binary
90+
*.exr binary
91+
*.fbx binary
92+
*.FBX binary
93+
*.fla binary
94+
*.flare binary
95+
*.flv binary
96+
*.gif binary
97+
*.gz binary
98+
*.ht binary
99+
*.ico binary
100+
*.jpeg binary
101+
*.jpg binary
102+
*.keystore binary
103+
*.mask binary
104+
*.mb binary
105+
*.mo binary
106+
*.mp3 binary
107+
*.mp4 binary
108+
*.mpg binary
109+
*.ogg binary
110+
*.PCX binary
111+
*.pcx binary
112+
*.pdb binary
113+
*.pdf binary
114+
*.png binary
115+
*.ps binary
116+
*.psd binary
117+
*.qt binary
118+
*.so binary
119+
*.swf binary
120+
*.tga binary
121+
*.tif binary
122+
*.tiff binary
123+
*.ttf binary
124+
*.TTF binary
125+
*.unitypackage binary
126+
*.unityPackage binary
127+
*.wav binary
128+
*.wmv binary
129+
*.zip binary
130+
*.ZIP binary

.gitignore

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Derived From:
2+
# http://kleber-swf.com/the-definitive-gitignore-for-unity-projects/
3+
4+
# ============= #
5+
# Working Files #
6+
# ============= #
7+
node_modules/
8+
npm-debug.log
9+
10+
# ===================================== #
11+
# Visual Studio / MonoDevelop generated #
12+
# ===================================== #
13+
bin
14+
obj
15+
ExportedObj/
16+
*.svd
17+
*.userprefs
18+
*.pidb
19+
*.suo
20+
*.user
21+
*.unityproj
22+
*.booproj
23+
*.pdb
24+
*.pdb.meta
25+
26+
# ============ #
27+
# OS generated #
28+
# ============ #
29+
.DS_Store
30+
.DS_Store?
31+
*~
32+
._*
33+
.Spotlight-V100
34+
.Trashes
35+
Icon?
36+
ehthumbs.db
37+
Thumbs.db

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2013-2017 Rotorz Limited
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# unity3d-localized-strings
2+
3+
A lightweight localization framework for Unity editor scripts.
4+
5+
```sh
6+
$ npm install rotorz/unity3d-localized-strings
7+
```
8+
9+
This package is compatible with [unity3d-package-syncer](https://github.com/rotorz/unity3d-package-syncer).
10+
11+
12+
## Setting up an environment with a single language domain
13+
14+
A custom language domain can be defined for a package in the following way:
15+
16+
```csharp
17+
// Editor/MyPackageLang.cs
18+
using Rotorz.Games.Localization;
19+
using System.Globalization;
20+
21+
[DiscoverablePackageLanguage]
22+
public sealed class MyPackageLang : PackageLanguage<MyPackageLang>
23+
{
24+
public MyPackageLang()
25+
: base("@my-vendor-name/my-package", CultureInfo.GetCultureInfo("en-US"))
26+
{
27+
}
28+
29+
30+
// Additional custom helper functionality can be implemented here if required...
31+
}
32+
```
33+
34+
This can then be consumed in editor scripts:
35+
36+
```csharp
37+
// Present label with localizable text to the user.
38+
GUILayout.Label(MyPackageLang.Text("Hello, world!"));
39+
```
40+
41+
42+
## Contribution Agreement
43+
44+
This project is licensed under the MIT license (see LICENSE). To be in the best
45+
position to enforce these licenses the copyright status of this project needs to
46+
be as simple as possible. To achieve this the following terms and conditions
47+
must be met:
48+
49+
- All contributed content (including but not limited to source code, text,
50+
image, videos, bug reports, suggestions, ideas, etc.) must be the
51+
contributors own work.
52+
53+
- The contributor disclaims all copyright and accepts that their contributed
54+
content will be released to the public domain.
55+
56+
- The act of submitting a contribution indicates that the contributor agrees
57+
with this agreement. This includes (but is not limited to) pull requests, issues,
58+
tickets, e-mails, newsgroups, blogs, forums, etc.

assets/Editor.meta

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/Editor/Localization.meta

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// Copyright (c) Rotorz Limited. All rights reserved.
2+
// Licensed under the MIT license. See LICENSE file in the project root.
3+
4+
using System;
5+
6+
namespace Rotorz.Games.Localization
7+
{
8+
/// <summary>
9+
/// Allows <see cref="PackageLanguage"/> implementations to be automatically
10+
/// discovered by the <see cref="PackageLanguageManager"/>.
11+
/// </summary>
12+
/// <seealso cref="PackageLanguage{TImplementation}"/>
13+
/// <seealso cref="PackageLanguage"/>
14+
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = true)]
15+
public sealed class DiscoverablePackageLanguageAttribute : Attribute
16+
{
17+
}
18+
}

assets/Editor/Localization/DiscoverablePackageLanguageAttribute.cs.meta

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)