Skip to content

Commit 40baf27

Browse files
committed
Some documentation
1 parent c2228b1 commit 40baf27

3 files changed

Lines changed: 39 additions & 11 deletions

File tree

-700 KB
Binary file not shown.

Assets/DFT Games/Localization/Demo/Scenes/LocalizedMenu.unity

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,7 @@ RectTransform:
502502
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
503503
m_AnchorMin: {x: 0.5, y: 0.5}
504504
m_AnchorMax: {x: 0.5, y: 0.5}
505-
m_AnchoredPosition: {x: 0, y: 166}
505+
m_AnchoredPosition: {x: 0, y: 70.000015}
506506
m_SizeDelta: {x: 200, y: 60}
507507
m_Pivot: {x: 0.5, y: 0.5}
508508
--- !u!114 &810926691
@@ -821,7 +821,7 @@ RectTransform:
821821
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
822822
m_AnchorMin: {x: 0.5, y: 0.5}
823823
m_AnchorMax: {x: 0.5, y: 0.5}
824-
m_AnchoredPosition: {x: 0.000029191, y: 79}
824+
m_AnchoredPosition: {x: 0.000029191, y: -17}
825825
m_SizeDelta: {x: 200, y: 60}
826826
m_Pivot: {x: 0.5, y: 0.5}
827827
--- !u!114 &1289590009
@@ -932,8 +932,8 @@ RectTransform:
932932
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
933933
m_AnchorMin: {x: 0.5, y: 0.5}
934934
m_AnchorMax: {x: 0.5, y: 0.5}
935-
m_AnchoredPosition: {x: 0, y: 272.93}
936-
m_SizeDelta: {x: 800, y: 100}
935+
m_AnchoredPosition: {x: 0.3, y: 235.4}
936+
m_SizeDelta: {x: 966.4, y: 250.9}
937937
m_Pivot: {x: 0.5, y: 0.5}
938938
--- !u!114 &1323607256
939939
MonoBehaviour:
@@ -964,8 +964,8 @@ MonoBehaviour:
964964
m_fontMaterials: []
965965
m_fontColor32:
966966
serializedVersion: 2
967-
rgba: 4278320896
968-
m_fontColor: {r: 0, g: 1, b: 0.006896496, a: 1}
967+
rgba: 4278321151
968+
m_fontColor: {r: 1, g: 1, b: 0.006896496, a: 1}
969969
m_enableVertexGradient: 0
970970
m_fontColorGradient:
971971
topLeft: {r: 1, g: 1, b: 1, a: 1}
@@ -982,12 +982,12 @@ MonoBehaviour:
982982
m_outlineColor:
983983
serializedVersion: 2
984984
rgba: 4278190080
985-
m_fontSize: 74.6
985+
m_fontSize: 185.6
986986
m_fontSizeBase: 36
987987
m_fontWeight: 400
988988
m_enableAutoSizing: 1
989-
m_fontSizeMin: 18
990-
m_fontSizeMax: 211.42
989+
m_fontSizeMin: 100
990+
m_fontSizeMax: 500
991991
m_fontStyle: 3
992992
m_textAlignment: 514
993993
m_isAlignmentEnumConverted: 1
@@ -1019,7 +1019,7 @@ MonoBehaviour:
10191019
m_firstVisibleCharacter: 0
10201020
m_useMaxVisibleDescender: 1
10211021
m_pageToDisplay: 1
1022-
m_margin: {x: 0, y: 0, z: 0, w: 0}
1022+
m_margin: {x: 0, y: 0, z: 0, w: 2.2212224}
10231023
m_textInfo:
10241024
textComponent: {fileID: 1323607256}
10251025
characterCount: 5
@@ -1473,7 +1473,7 @@ RectTransform:
14731473
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
14741474
m_AnchorMin: {x: 0.5, y: 0.5}
14751475
m_AnchorMax: {x: 0.5, y: 0.5}
1476-
m_AnchoredPosition: {x: 0.0000013269, y: -8}
1476+
m_AnchoredPosition: {x: 0.0000013269, y: -103.999985}
14771477
m_SizeDelta: {x: 200, y: 60}
14781478
m_Pivot: {x: 0.5, y: 0.5}
14791479
--- !u!114 &2034916618
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
DFT Games Localization Solution
2+
-------------------------------
3+
This package delivers 2 independant features:
4+
*) Text localization (both UGUI and Text Mesh Pro)
5+
*) UI Images localization (2D Sprites)
6+
7+
Two are the steps to implement localization:
8+
1) Prepare the localized files
9+
2) Add the script to the UI elements you want to localize
10+
11+
-- Localized Files --
12+
The necessary files must be located in the following folders:
13+
Resources\localization
14+
Here you add the language files. Each file must be named following the scheme <LanguageName>.txt
15+
so for English you'll create a file named English.txt, for Italian the file will be Italian.txt
16+
and so on.
17+
The file content is: one key/value per line. valid key/value separator are the equal sign and the Tab character.
18+
To add a newline simply use the sequence \n
19+
20+
Resources\localization\UI\<LanguageName>
21+
Be sure to use the same sprite name for all its version and store each sprite in its language specific folder.
22+
23+
The language name must be one of those listed here: https://docs.unity3d.com/ScriptReference/SystemLanguage.html
24+
25+
Once you have prepared the files all you have to do is to add the correct script component to the UI element you want to localize.
26+
LocalizeImage for the UI Images
27+
Localize for the UGUI Text
28+
LocalizeTM for Text Mesh Pro UGUI

0 commit comments

Comments
 (0)