Skip to content

Commit 065de21

Browse files
authored
Add Electron API endpoints for app locale information (#247)
1 parent a7f4ded commit 065de21

File tree

2 files changed

+33
-0
lines changed
  • resources/js/electron-plugin

2 files changed

+33
-0
lines changed

resources/js/electron-plugin/dist/server/api/app.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,21 @@ router.get('/is-hidden', (req, res) => {
2222
is_hidden: app.isHidden(),
2323
});
2424
});
25+
router.get('/locale', (req, res) => {
26+
res.json({
27+
locale: app.getLocale(),
28+
});
29+
});
30+
router.get('/locale-country-code', (req, res) => {
31+
res.json({
32+
locale_country_code: app.getLocaleCountryCode(),
33+
});
34+
});
35+
router.get('/system-locale', (req, res) => {
36+
res.json({
37+
system_locale: app.getSystemLocale(),
38+
});
39+
});
2540
router.get('/app-path', (req, res) => {
2641
res.json({
2742
path: app.getAppPath(),

resources/js/electron-plugin/src/server/api/app.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,24 @@ router.get('/is-hidden', (req, res) => {
2828
})
2929
});
3030

31+
router.get('/locale', (req, res) => {
32+
res.json({
33+
locale: app.getLocale(),
34+
})
35+
});
36+
37+
router.get('/locale-country-code', (req, res) => {
38+
res.json({
39+
locale_country_code: app.getLocaleCountryCode(),
40+
})
41+
});
42+
43+
router.get('/system-locale', (req, res) => {
44+
res.json({
45+
system_locale: app.getSystemLocale(),
46+
})
47+
});
48+
3149
router.get('/app-path', (req, res) => {
3250
res.json({
3351
path: app.getAppPath(),

0 commit comments

Comments
 (0)