Skip to content
This repository has been archived by the owner on Aug 14, 2024. It is now read-only.

1.add translate.json public/assets/locals/zh/translations #892

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions public/locales/en/translate.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"about.microsoftcopywrite": "Microsoft, Windows and Other demonstrated Products in this project are trademarks of the Microsoft group of companies",
"about.understand": "Ok, I understand",
"about.contact": "contact",

"store.featured-app": "Featured Apps",
"store.featured-app.info": "Take your experience to new heights with these must-have apps",
"store.featured-game": "Featured Games",
Expand Down
28 changes: 28 additions & 0 deletions public/locales/zh/translate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"about.opensource": "win11 是一个开源项目,旨在通过React、css、JavaScript等标准web技术,在web上复制window11的桌面体验",
"about.notmicrosoft": "这个项目不属于Microsoft,不应与它的操作系统或产品混淆",
"about.Creative-Commons": "Creative-Commons",
"about.title": "About",
"about.licensed": "本项目的开源协议",
"about.alsonot": "这同样不是",
"about.microsoftcopywrite": "这个项目的Microsoft、Windows和其他演示产品均为Microsoft公司的商标",
"about.understand": "好的",
"about.contact": "联系方式",

"store.featured-app": "精选应用",
"store.featured-app.info": "用这些必备的应用把你的体验带到新的高度",
"store.featured-game": "精选游戏",
"store.featured-game.info": "探索Xbox游戏的乐趣,并发现你的最爱",
"store.featured-film": "精选电影",
"store.featured-film.info": "租赁或购买最新热门电影,在家或者旅途中观看",
"store.free": "免费",
"store.owned": "已拥有",
"store.rent": "租赁",
"store.features": "精选",
"store.ratings": "评分与评论",
"store.description": "描述",
"camera.take-photo": "拍照",
"oobe.country": "国家和地区是否正确?",
"oobe.keyboard": "键盘布局或输入法是否正确",
"oobe.anotherkeyboard": "如果你使用其他的键盘布局,你可以在下方添加"
}
48 changes: 43 additions & 5 deletions src/App.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useEffect } from "react";
import { useEffect, useRef, useState } from "react";
import { ErrorBoundary } from "react-error-boundary";
import { useDispatch, useSelector } from "react-redux";
import "./i18nextConf";
Expand Down Expand Up @@ -70,6 +70,7 @@ function ErrorFallback({ error, resetErrorBoundary }) {
function App() {
const apps = useSelector((state) => state.apps);
const wall = useSelector((state) => state.wallpaper);
const isfullScreen = useSelector((state) => state.menus.fullScreen);
const dispatch = useDispatch();

const afterMath = (event) => {
Expand All @@ -88,7 +89,7 @@ function App() {
} catch (err) {}

var actionType0 = getComputedStyle(event.target).getPropertyValue(
"--prefix",
"--prefix"
);

ess.forEach((item, i) => {
Expand Down Expand Up @@ -125,7 +126,44 @@ function App() {
window.onload = (e) => {
dispatch({ type: "WALLBOOTED" });
};
document.addEventListener("fullscreenchange", ()=>{
if(document.fullscreenElement===null){
// exit
console.log('exit');
dispatch({type:"FULLSREEN"})
}
},true);

function fullScreen(element) {
const runfullScreen =
element.requestFullscreen ||
element.mozRequestFullScreen ||
element.webkitRequestFullScreen ||
element.msRequestFullscreen;
if (runfullScreen) runfullScreen.call(element);
else {
console.error("当前浏览器不支持部分全屏!");
}
}
function exitFullScreen() {
const runExit =
document.exitFullscreen ||
document.mozCancelFullScreen ||
document.webkitExitFullscreen ||
document.msExitFullscreen;

if (runExit) runExit.call(document);
else {
console.error("当前浏览器不支持退出全屏!");
}
}
const App = useRef(null);
if (isfullScreen) {
fullScreen(App.current);
} else if (document.fullscreenElement !== null) {
exitFullScreen();
dispatch({type:"FULLSREEN"})
}
useEffect(() => {
if (!window.onstart) {
loadSettings();
Expand All @@ -137,7 +175,7 @@ function App() {
});

return (
<div className="App">
<div className="App" ref={App}>
<ErrorBoundary FallbackComponent={ErrorFallback}>
{!wall.booted ? <BootScreen dir={wall.dir} /> : null}
{wall.locked ? <LockScreen dir={wall.dir} /> : null}
Expand All @@ -149,15 +187,15 @@ function App() {
var WinApp = Applications[key];
return <WinApp key={idx} />;
})}
{Object.keys(apps)
{/* {Object.keys(apps)
.filter((x) => x != "hz")
.map((key) => apps[key])
.map((app, i) => {
if (app.pwa) {
var WinApp = Drafts[app.data.type];
return <WinApp key={i} icon={app.icon} {...app.data} />;
}
})}
})} */}
<StartMenu />
<BandPane />
<SidePane />
Expand Down
5 changes: 4 additions & 1 deletion src/containers/applications/apps/terminal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,10 @@ export const WnTerminal = () => {
tmpStack.push("Network Org: " + IP.org);
tmpStack.push("Region: " + IP.region);
tmpStack.push("Postal: " + IP.postal);
} else {
}else if(type=="ls"){
tmpStack.push("visit https://github.com/blueedgetechno/win11React");
}
else {
tmpStack.push(
`'${type}' is not recognized as an internal or external command,`,
);
Expand Down
15 changes: 15 additions & 0 deletions src/reducers/menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const defState = {
opts: "desk",
attr: null,
dataset: null,
fullScreen:false,
data: {
desk: {
width: "310px",
Expand Down Expand Up @@ -75,6 +76,11 @@ const defState = {
},
],
},
{
name:"fullScreen",
action:"FULLSCREEN",
type:"svg",
},
{
name: "Refresh",
action: "refresh",
Expand Down Expand Up @@ -264,6 +270,15 @@ const menusReducer = (state = defState, action) => {
tmpState = {
...action.payload,
};
} else if(action.type==="FULLSCREEN"){
tmpState.fullScreen=!tmpState.fullScreen
tmpState.menus.desk.forEach(obj=>{
if(obj.name==='fullScreen'){
obj.name='exit fullSreen'
}else if(obj.name==='exit fullSreen'){
obj.name='fullScreen'
}
})
}

return tmpState;
Expand Down
Loading