Skip to content

traduções #53

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
198 changes: 95 additions & 103 deletions README.md

Large diffs are not rendered by default.

72 changes: 46 additions & 26 deletions i18n.json
Original file line number Diff line number Diff line change
@@ -1,126 +1,146 @@
{
"lan": ["cn", "en", "fr", "fa"],
"default": "cn",
"lan": ["cn", "en", "fr", "fa", "pt"],
"default": "pt",
"data": {
"title": {
"cn": "俄罗斯方块",
"en": "T E T R I S",
"fr": "T E T R I S",
"fa": "خانه سازی"
"cn": "水豚幣",
"en": "Capivara Coin",
"fr": "Capivara Coin",
"fa": "Pièce de Capybara",
"pt": "Capivara Coin"
},
"github": {
"cn": "GitHub",
"en": "GitHub",
"fr": "GitHub",
"fa": "گیت‌هاب"
"fa": "گیت‌هاب",
"pt": "GitHub"
},
"linkTitle": {
"cn": "查看源代码",
"en": "View data source",
"fr": "Afficher la source des données",
"fa": "مشاهده سورس پروژه"
"fa": "مشاهده سورس پروژه",
"pt": "Ver código-fonte"
},
"QRCode":{
"QRCode": {
"cn": "二维码",
"en": "QR code",
"fr": "QR code",
"fa": "کیوآر کد"
"fa": "کیوآر کد",
"pt": "Código QR"
},
"titleCenter": {
"cn": "俄罗斯方块<br />TETRIS",
"en": "TETRIS",
"fr": "TETRIS",
"fa": "خانه سازی"
"fa": "خانه سازی",
"pt": "TETRIS"
},
"point": {
"cn": "得分",
"en": "Point",
"fr": "Score",
"fa": "امتیاز"
"fa": "امتیاز",
"pt": "Pontuação"
},
"highestScore": {
"cn": "最高分",
"en": "Max",
"fr": "Max",
"fa": "حداکثر"
"fa": "حداکثر",
"pt": "Máxima"
},
"lastRound": {
"cn": "上轮得分",
"en": "Last Round",
"fr": "Dernier Tour",
"fa": "آخرین دور"
"fa": "آخرین دور",
"pt": "Última Rodada"
},
"cleans": {
"cn": "消除行",
"en": "Cleans",
"fr": "Lignes",
"fa": "پاک کرد"
"fa": "پاک کرد",
"pt": "Linhas Eliminadas"
},
"level": {
"cn": "级别",
"en": "Level",
"fr": "Difficulté",
"fa": "سطح"
"fa": "سطح",
"pt": "Nível"
},
"startLine": {
"cn": "起始行",
"en": "Start Line",
"fr": "Ligne Départ",
"fa": "خط شروع"
"fa": "خط شروع",
"pt": "Começo"
},
"next": {
"cn": "下一个",
"en": "Next",
"fr": "Prochain",
"fa": "بعدی"
"fa": "بعدی",
"pt": "Próximo"
},
"pause": {
"cn": "暂停",
"en": "Pause",
"fr": "Pause",
"fa": "مکث"
"fa": "مکث",
"pt": "Pausar"
},
"sound": {
"cn": "音效",
"en": "Sound",
"fr": "Sonore",
"fa": "صدا"
"fa": "صدا",
"pt": "Som"
},
"reset": {
"cn": "重玩",
"en": "Reset",
"fr": "Réinitialiser",
"fa": "ریست"
"fa": "ریست",
"pt": "Reiniciar"
},
"rotation": {
"cn": "旋转",
"en": "Rotation",
"fr": "Rotation",
"fa": "چرخش"
"fa": "چرخش",
"pt": "Girar"
},
"left": {
"cn": "左移",
"en": "Left",
"fr": "Gauche",
"fa": "چپ"
"fa": "چپ",
"pt": "Esquerda"
},
"right": {
"cn": "右移",
"en": "Right",
"fr": "Droite",
"fa": "راست"
"fa": "راست",
"pt": "Direita"
},
"down": {
"cn": "下移",
"en": "Down",
"fr": "Bas",
"fa": "پایین"
"fa": "پایین",
"pt": "Descer"
},
"drop": {
"cn": "掉落",
"en": "Drop",
"fr": "Tomber",
"fa": "سقوط"
"fa": "سقوط",
"pt": "Soltar"
}
}
}
11,888 changes: 11,888 additions & 0 deletions package-lock.json

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions server/index.html
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
<!DOCTYPE html>
<html lang="en">
<html lang="Pt-br">
<head>
<meta name="renderer" content="webkit">
<meta name="description" content="使用React、Redux、Immutable制作的俄罗斯方块" />
<meta name="keywords" content="俄罗斯方块,Tetris,React,Redux,Immuatble,JavaScript">
<meta name="description" content="Airdrop - Capivara Coin " />
<meta name="keywords" content="Airdrop, Memecoin, Capivara">
<meta name="format-detection" content="telephone=no"/>
<script>;(function(){var w=parseInt(window.screen.width),s=w/640,u=navigator.userAgent.toLowerCase(),m='<meta name="viewport" content="width=640,';if(/android (\d+\.\d+)/.test(u)){if(parseFloat(RegExp.$1)>2.3)m+='minimum-scale='+s+',maximum-scale='+s+',';}else{m+='user-scalable=no,';}m+='target-densitydpi=device-dpi">';document.write(m);}());</script>
<meta charset="UTF-8">
<title>俄罗斯方块</title>
<title>Capivara Coin</title>
<link href="./loader.css" rel="stylesheet" />
<link href="./css.css" rel="stylesheet">
</head>
<body>
<div id="root">
<div class="load">
<div class="loader">加载中...</div>
<div class="loader">Carregando...</div>
</div>
</div>
<script src="app.js"></script>
10 changes: 5 additions & 5 deletions server/index.tmpl.html
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
<!DOCTYPE html>
<html lang="en">
<html lang="Pt-br">
<head>
<meta name="renderer" content="webkit">
<meta name="description" content="使用React、Redux、Immutable制作的俄罗斯方块" />
<meta name="keywords" content="俄罗斯方块,Tetris,React,Redux,Immuatble,JavaScript">
<meta name="description" content="Airdrop - Capivara Coin" />
<meta name="keywords" content="Airdrop, Memecoin, Capivara">
<meta name="format-detection" content="telephone=no"/>
<script>;(function(){var w=parseInt(window.screen.width),s=w/640,u=navigator.userAgent.toLowerCase(),m='<meta name="viewport" content="width=640,';if(/android (\d+\.\d+)/.test(u)){if(parseFloat(RegExp.$1)>2.3)m+='minimum-scale='+s+',maximum-scale='+s+',';}else{m+='user-scalable=no,';}m+='target-densitydpi=device-dpi">';document.write(m);}());</script>
<meta charset="UTF-8">
<title>俄罗斯方块</title>
<title>Capivara Coin</title>
<link href="./loader.css" rel="stylesheet" />
</head>
<body>
<div id="root">
<div class="load">
<div class="loader">加载中...</div>
<div class="loader">Carregando</div>
</div>
</div>
</body>
2 changes: 1 addition & 1 deletion src/components/logo/index.js
Original file line number Diff line number Diff line change
@@ -17,7 +17,7 @@ export default class Logo extends React.Component {
this.animate(this.props);
}
componentWillReceiveProps(nextProps) {
if ( // 只有在游戏进入开始, 或结束时 触发改变
if ( // As alterações só são acionadas quando o jogo entra no início ou termina
(
[this.props.cur, nextProps.cur].indexOf(false) !== -1 &&
(this.props.cur !== nextProps.cur)
58 changes: 29 additions & 29 deletions src/unit/index.js
Original file line number Diff line number Diff line change
@@ -1,51 +1,51 @@
import { blockType, StorageKey } from './const';

const hiddenProperty = (() => { // document[hiddenProperty] 可以判断页面是否失焦
let names = [
const propriedadeOculta = (() => { // document[hiddenProperty] pode determinar se a página perdeu o foco
let nomes = [
'hidden',
'webkitHidden',
'mozHidden',
'msHidden',
];
names = names.filter((e) => (e in document));
return names.length > 0 ? names[0] : false;
nomes = nomes.filter((e) => (e in document));
return nomes.length > 0 ? nomes[0] : false;
})();

const visibilityChangeEvent = (() => {
if (!hiddenProperty) {
const eventoMudancaVisibilidade = (() => {
if (!propriedadeOculta) {
return false;
}
return hiddenProperty.replace(/hidden/i, 'visibilitychange'); // 如果属性有前缀, 相应的事件也有前缀
return propriedadeOculta.replace(/hidden/i, 'visibilitychange'); // Se a propriedade tem prefixo, o evento correspondente também terá
})();

const isFocus = () => {
if (!hiddenProperty) { // 如果不存在该特性, 认为一直聚焦
const estaFocado = () => {
if (!propriedadeOculta) { // Se essa característica não existe, assume-se que está sempre focado
return true;
}
return !document[hiddenProperty];
return !document[propriedadeOculta];
};

const unit = {
getNextType() { // 随机获取下一个方块类型
const unidade = {
getProximoTipo() { // Obter o próximo tipo de bloco aleatoriamente
const len = blockType.length;
return blockType[Math.floor(Math.random() * len)];
},
want(next, matrix) { // 方块是否能移到到指定位置
quer(next, matrix) { // O bloco pode mover para a posição especificada?
const xy = next.xy;
const shape = next.shape;
const horizontal = shape.get(0).size;
return shape.every((m, k1) => (
m.every((n, k2) => {
if (xy[1] < 0) { // left
if (xy[1] < 0) { // esquerda
return false;
}
if (xy[1] + horizontal > 10) { // right
if (xy[1] + horizontal > 10) { // direita
return false;
}
if (xy[0] + k1 < 0) { // top
if (xy[0] + k1 < 0) { // topo
return true;
}
if (xy[0] + k1 >= 20) { // bottom
if (xy[0] + k1 >= 20) { // fundo
return false;
}
if (n) {
@@ -58,25 +58,25 @@ const unit = {
})
));
},
isClear(matrix) { // 是否达到消除状态
const clearLines = [];
estaLimpo(matrix) { // Estado de limpeza alcançado?
const linhasLimpar = [];
matrix.forEach((m, k) => {
if (m.every(n => !!n)) {
clearLines.push(k);
linhasLimpar.push(k);
}
});
if (clearLines.length === 0) {
if (linhasLimpar.length === 0) {
return false;
}
return clearLines;
return linhasLimpar;
},
isOver(matrix) { // 游戏是否结束, 第一行落下方块为依据
estaTerminado(matrix) { // O jogo terminou? A primeira linha com bloco é o critério
return matrix.get(0).some(n => !!n);
},
subscribeRecord(store) { // 将状态记录到 localStorage
registrarRecord(store) { // Registrar estado no localStorage
store.subscribe(() => {
let data = store.getState().toJS();
if (data.lock) { // 当状态为锁定, 不记录
if (data.lock) { // Quando o estado está bloqueado, não registrar
return;
}
data = JSON.stringify(data);
@@ -87,7 +87,7 @@ const unit = {
localStorage.setItem(StorageKey, data);
});
},
isMobile() { // 判断是否为移动端
ehMobile() { // Determinar se é um dispositivo móvel
const ua = navigator.userAgent;
const android = /Android (\d+\.\d+)/.test(ua);
const iphone = ua.indexOf('iPhone') > -1;
@@ -96,8 +96,8 @@ const unit = {
const nokiaN = ua.indexOf('NokiaN') > -1;
return android || iphone || ipod || ipad || nokiaN;
},
visibilityChangeEvent,
isFocus,
eventoMudancaVisibilidade,
estaFocado,
};

module.exports = unit;
module.exports = unidade;
63 changes: 31 additions & 32 deletions w.config.js
Original file line number Diff line number Diff line change
@@ -7,26 +7,25 @@ var autoprefixer = require('autoprefixer');
var CopyWebpackPlugin = require('copy-webpack-plugin');
var version = require('./package.json').version;

// Entrada do programa
var entrada = __dirname + '/src/index.js';

// 程序入口
var entry = __dirname + '/src/index.js';

// 输出文件
var output = {
// Arquivo de saída
var saida = {
filename: 'page/[name]/index.js',
chunkFilename: 'chunk/[name].[chunkhash:5].chunk.js',
};

// 生成source-map追踪js错误
var devtool = 'source-map';
// Gerar source-map para rastreamento de erros de js
var ferramentaDev = 'source-map';

// eslint
var eslint = {
configFile: __dirname + '/.eslintrc.js',
}

// loader
var loaders = [
var carregadores = [
{
test: /\.(json)$/,
exclude: /node_modules/,
@@ -39,81 +38,81 @@ var loaders = [
},
{
test: /\.(?:png|jpg|gif)$/,
loader: 'url?limit=8192', //小于8k,内嵌;大于8k生成文件
loader: 'url?limit=8192', // Arquivos menores que 8k serão embutidos; maiores que 8k serão gerados como arquivo
},
{
test: /\.less/,
loader: ExtractTextPlugin.extract('style', 'css?modules&localIdentName=[hash:base64:4]!postcss!less'),
}
];

// dev plugin
var devPlugins = [
// Plugins de desenvolvimento
var pluginsDev = [
new CopyWebpackPlugin([
{ from: './src/resource/music/music.mp3' },
{ from: './src/resource/css/loader.css' },
]),
// 热更新
// Hot module replacement
new webpack.HotModuleReplacementPlugin(),
// 允许错误不打断程序, 仅开发模式需要
// Permitir erros sem interromper o programa, necessário apenas no modo de desenvolvimento
new webpack.NoErrorsPlugin(),
// 打开浏览器页面
// Abrir página no navegador
new OpenBrowserPlugin({
url: 'http://127.0.0.1:8080/'
}),
// css打包
// Empacotar CSS
new ExtractTextPlugin('css.css', {
allChunks: true
}),
]

// production plugin
var productionPlugins = [
// 定义生产环境
// Plugins de produção
var pluginsProducao = [
// Definir ambiente de produção
new webpack.DefinePlugin({
'process.env.NODE_ENV': '"production"',
}),
// 复制
// Copiar arquivos
new CopyWebpackPlugin([
{ from: './src/resource/music/music.mp3' },
{ from: './src/resource/css/loader.css' },
]),
// HTML 模板
// Template HTML
new HtmlWebpackPlugin({
template: __dirname + '/server/index.tmpl.html'
}),
// JS压缩
// Minificar JS
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false
}}
),
// css打包
// Empacotar CSS
new ExtractTextPlugin('css-' + version + '.css', {
allChunks: true
}),
];

// dev server
var devServer = {
// Servidor de desenvolvimento
var servidorDev = {
contentBase: './server',
colors: true,
historyApiFallback: false,
port: 8080, // defaults to "8080"
port: 8080, // padrão é "8080"
hot: true, // Hot Module Replacement
inline: true, // Livereload
host: '0.0.0.0',
disableHostCheck: true
};

module.exports = {
entry: entry,
devtool: devtool,
output: output,
loaders: loaders,
devPlugins: devPlugins,
productionPlugins: productionPlugins,
devServer: devServer,
entry: entrada,
devtool: ferramentaDev,
output: saida,
loaders: carregadores,
devPlugins: pluginsDev,
productionPlugins: pluginsProducao,
devServer: servidorDev,
postcss: function () {
return [precss, autoprefixer];
},