mirror of
https://github.com/clockworkpi/launcher.git
synced 2025-12-15 03:08:50 +01:00
MultiLabel add iscjk
This commit is contained in:
parent
493a920500
commit
40cafe09c5
@ -17,6 +17,7 @@ class LangManager(object):
|
|||||||
_Langs = {}
|
_Langs = {}
|
||||||
_Config = None
|
_Config = None
|
||||||
_ConfigFileName = "00_English.ini" ## double % to escape
|
_ConfigFileName = "00_English.ini" ## double % to escape
|
||||||
|
_CJKMode = False
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.Init()
|
self.Init()
|
||||||
@ -29,6 +30,17 @@ class LangManager(object):
|
|||||||
self._Langs = {}
|
self._Langs = {}
|
||||||
self.SetLangs()
|
self.SetLangs()
|
||||||
|
|
||||||
|
def IsCJKMode(self):## in MultiLabel, latins seped by white spaces,CJK no needs for that
|
||||||
|
latins = ["English"]
|
||||||
|
self._CJKMode = True
|
||||||
|
|
||||||
|
for i in latins:
|
||||||
|
if i in self._ConfigFileName:
|
||||||
|
self._CJKMode= False
|
||||||
|
break
|
||||||
|
|
||||||
|
return self._CJKMode
|
||||||
|
|
||||||
def SetLangs(self):
|
def SetLangs(self):
|
||||||
self._Config = CaseConfigParser()
|
self._Config = CaseConfigParser()
|
||||||
#print("SetLangs")
|
#print("SetLangs")
|
||||||
|
|||||||
@ -3,6 +3,7 @@
|
|||||||
import pygame
|
import pygame
|
||||||
|
|
||||||
from skin_manager import MySkinManager
|
from skin_manager import MySkinManager
|
||||||
|
from lang_manager import MyLangManager
|
||||||
|
|
||||||
|
|
||||||
class MultiLabel: ##Multi Line Label
|
class MultiLabel: ##Multi Line Label
|
||||||
@ -49,15 +50,27 @@ class MultiLabel: ##Multi Line Label
|
|||||||
self._CanvasHWND = _canvashwnd
|
self._CanvasHWND = _canvashwnd
|
||||||
|
|
||||||
def blit_text(self, surface,text, pos, font):
|
def blit_text(self, surface,text, pos, font):
|
||||||
|
iscjk = MyLangManager.IsCJKMode()
|
||||||
|
|
||||||
color = self._Color
|
color = self._Color
|
||||||
words = [word.split(' ') for word in text.splitlines()]
|
words = [word.split(' ') for word in text.splitlines()]
|
||||||
space = font.size(' ')[0]
|
space = font.size(' ')[0]
|
||||||
|
|
||||||
|
if iscjk:
|
||||||
|
space = 0
|
||||||
|
words = [list(word.decode("utf8")) for word in text.splitlines()]
|
||||||
|
|
||||||
max_width = self._Width
|
max_width = self._Width
|
||||||
x ,y = pos
|
x ,y = pos
|
||||||
row_total_width = 0
|
row_total_width = 0
|
||||||
lines = 0
|
lines = 0
|
||||||
for i,line in enumerate(words[:4]):
|
line_max = 12
|
||||||
for word in line[:12]:
|
row_max = 4
|
||||||
|
if iscjk:
|
||||||
|
line_max = line_max*2
|
||||||
|
|
||||||
|
for i,line in enumerate(words[:row_max]):
|
||||||
|
for word in line[:line_max]:
|
||||||
word_surface = font.render(word, True, color)
|
word_surface = font.render(word, True, color)
|
||||||
word_width = word_surface.get_width()
|
word_width = word_surface.get_width()
|
||||||
word_height = word_surface.get_height()
|
word_height = word_surface.get_height()
|
||||||
|
|||||||
@ -26,23 +26,23 @@ AddFav=お気に入りに追加
|
|||||||
ADdFavList=お気に入りリストに登録
|
ADdFavList=お気に入りリストに登録
|
||||||
Del=削除
|
Del=削除
|
||||||
Please upload data over Wi-Fi=Wi-Fiでデータを送信してください
|
Please upload data over Wi-Fi=Wi-Fiでデータを送信してください
|
||||||
ConfirmDeleteQ=削除しますか?
|
ConfirmDeleteQ=削除しますか?
|
||||||
AlreadyExisted=既に存在している
|
AlreadyExisted=既に存在している
|
||||||
Cancel=取り消す
|
Cancel=取り消す
|
||||||
Yes=はい
|
Yes=はい
|
||||||
ConfirmQ=確認?
|
ConfirmQ=確認?
|
||||||
Disconnecting=接続を切断
|
Disconnecting=接続を切断
|
||||||
ConfirmUpdateToFQ=%%sにアップデートしますか?
|
ConfirmUpdateToFQ=%%sにアップデートしますか?
|
||||||
UpdateToFQ=%%sにアップデート?
|
UpdateToFQ=%%sにアップデート?
|
||||||
SetupGameEngineAutoQ=ゲームエンジンの自動セットアップを希望しますか?
|
SetupGameEngineAutoQ=ゲームエンジンの自動セットアップを希望しますか?
|
||||||
Downloading=ダウンロード中
|
Downloading=ダウンロード中
|
||||||
BATOver5Pct=バッテリーは5%%以上が必要
|
BATOver5Pct=バッテリーは5%%以上が必要
|
||||||
DeleteConfirm=削除の確認
|
DeleteConfirm=削除の確認
|
||||||
FavouriteGames=お気に入りのゲーム
|
FavouriteGames=お気に入りのゲーム
|
||||||
ConfirmForgetQ=無視しますか?
|
ConfirmForgetQ=無視しますか?
|
||||||
ConfirmForget=無視しますか
|
ConfirmForget=無視しますか
|
||||||
Disconnect=接続を切断
|
Disconnect=接続を切断
|
||||||
ConfirmDisconnectQ=接続を切りますか?
|
ConfirmDisconnectQ=接続を切りますか?
|
||||||
Confirm Disconnect=接続を切りますか
|
Confirm Disconnect=接続を切りますか
|
||||||
Forget=無視
|
Forget=無視
|
||||||
Forgeting=無視中
|
Forgeting=無視中
|
||||||
@ -100,7 +100,7 @@ Power saving=省エネルギー
|
|||||||
Balanced=バランス
|
Balanced=バランス
|
||||||
Server=サーバ
|
Server=サーバ
|
||||||
Performance=性能
|
Performance=性能
|
||||||
Confirm Power OFF?=電源オフしますか?
|
Confirm Power OFF?=電源オフしますか?
|
||||||
Reboot=再起動
|
Reboot=再起動
|
||||||
Shutdown=シャットダウン
|
Shutdown=シャットダウン
|
||||||
Play List=プレイリスト
|
Play List=プレイリスト
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user