Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
RLG Maker
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Romain DELEAU
RLG Maker
Commits
65603e5e
Commit
65603e5e
authored
Nov 14, 2023
by
Romain DELEAU
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change language button/menu
parent
195e9ef8
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
28 additions
and
12 deletions
+28
-12
app.component.html
src/app/app.component.html
+7
-3
app.component.scss
src/app/app.component.scss
+2
-1
app.component.ts
src/app/app.component.ts
+13
-8
en.json
src/assets/lang/en.json
+3
-0
fr.json
src/assets/lang/fr.json
+3
-0
No files found.
src/app/app.component.html
View file @
65603e5e
...
...
@@ -152,12 +152,16 @@
<input
type=
"file"
#
fileInput
style=
"display: none"
(
change
)="
onFileSelected
($
event
)"
>
</div>
<div
class=
"container-settings container-settings-secondline"
>
<button
mat-mini-fab
color=
"white"
style=
"font-size: 20px;"
[
matMenuTriggerFor
]="
changeLanguageMenu
"
[
matTooltip
]="
translate
.
instant
('
lang_tooltip
')"
matTooltipPosition=
"above"
[
matTooltipDisabled
]="!
tooltipService
.
activatedTooltips
"
>
{{langEmoji}}
</button>
<mat-menu
#
changeLanguageMenu=
"matMenu"
>
<button
mat-menu-item
(
click
)="
changeLanguage
('
fr
')"
>
🇫🇷 {{'language_fr' | translate}}
</button>
<button
mat-menu-item
(
click
)="
changeLanguage
('
en
')"
>
🇬🇧 {{'language_en' | translate}}
</button>
</mat-menu>
<button
mat-mini-fab
color=
"white"
(
click
)="
downloadManual
()"
[
matTooltip
]="
translate
.
instant
('
manual_tooltip
')"
matTooltipPosition=
"above"
[
matTooltipDisabled
]="!
tooltipService
.
activatedTooltips
"
><mat-icon
fontIcon=
"menu_book"
></mat-icon></button>
<button
mat-mini-fab
color=
"white"
(
click
)="
changeLanguage
()"
[
matTooltip
]="
translate
.
instant
('
lang_tooltip
')"
matTooltipPosition=
"above"
[
matTooltipDisabled
]="!
tooltipService
.
activatedTooltips
"
>
🇫🇷
</button>
</div>
<div
class=
"container-minimap"
></div>
<div
class=
"container-zoom"
>
...
...
src/app/app.component.scss
View file @
65603e5e
...
...
@@ -197,8 +197,9 @@
}
&
-secondline
{
width
:
50px
;
top
:
75px
;
width
:
112px
;
right
:
360px
;
}
}
...
...
src/app/app.component.ts
View file @
65603e5e
...
...
@@ -48,6 +48,7 @@ export class AppComponent {
scenario
:
Scenario
=
new
Scenario
();
@
ViewChild
(
'fileInput'
)
fileInput
:
any
;
selectedLang
:
string
=
'en'
;
langEmoji
:
string
=
'🇬🇧'
;
constructor
(
private
cdr
:
ChangeDetectorRef
,
private
http
:
HttpClient
,
protected
pieceDetailsService
:
PieceDetailsService
,
protected
tooltipService
:
TooltipService
,
private
elementRef
:
ElementRef
,
private
zoomService
:
ZoomService
,
private
dialog
:
MatDialog
,
private
titleService
:
Title
,
...
...
@@ -63,6 +64,10 @@ export class AppComponent {
this
.
selectedLang
=
selectedLang
;
}
translate
.
use
(
this
.
selectedLang
);
switch
(
selectedLang
)
{
case
'en'
:
this
.
langEmoji
=
'🇬🇧'
;
break
;
case
'fr'
:
this
.
langEmoji
=
'🇫🇷'
;
break
;
}
pieceDetailsService
.
piece
=
this
.
scenario
;
...
...
@@ -114,15 +119,15 @@ export class AppComponent {
}
}
changeLanguage
():
void
{
if
(
this
.
selectedLang
==
'en'
)
{
this
.
selectedLang
=
'fr'
;
this
.
translate
.
use
(
'fr'
);
}
else
if
(
this
.
selectedLang
==
'fr'
)
{
this
.
selectedLang
=
'en'
;
this
.
translate
.
use
(
'en'
);
changeLanguage
(
lang
:
string
):
void
{
if
(
lang
!==
this
.
selectedLang
)
{
switch
(
lang
)
{
case
'fr'
:
this
.
selectedLang
=
'fr'
;
this
.
translate
.
use
(
'fr'
);
this
.
langEmoji
=
'🇫🇷'
;
break
;
case
'en'
:
this
.
selectedLang
=
'en'
;
this
.
translate
.
use
(
'en'
);
this
.
langEmoji
=
'🇬🇧'
;
break
;
}
this
.
minimapService
.
reset
();
this
.
scenario
.
traces
.
push
(
new
Trace
(
this
.
scenario
.
traces
.
length
,
'change_lang'
,
undefined
,
undefined
,
'all'
,
'Scenario'
));
}
this
.
minimapService
.
reset
();
}
downloadManual
():
void
{
...
...
src/assets/lang/en.json
View file @
65603e5e
{
"language_fr"
:
"French"
,
"language_en"
:
"English"
,
"clearPiece_tooltip"
:
"Clear the content of this tile."
,
"deletePiece_tooltip"
:
"Delete the tile"
,
"moveRight_tooltip"
:
"Shift the tile to the right. In case a tile is already present, their positions are swapped."
,
...
...
src/assets/lang/fr.json
View file @
65603e5e
{
"language_fr"
:
"Français"
,
"language_en"
:
"Anglais"
,
"clearPiece_tooltip"
:
"Effacer le contenu de cette tuile"
,
"deletePiece_tooltip"
:
"Supprimer la tuile"
,
"moveRight_tooltip"
:
"Décaler la tuile vers la droite. Dans le cas où une tuile est déjà présente, leurs places sont inversées."
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment