【翻译 Electron】1.Introduction 介绍

161 阅读4分钟

前言

阅读英文文档是每一个前端的基操了,但是菜鸡如我看到英语脑壳就疼,但是为了称为一名合格的前端 coder, 那必须得克服困难啊,所以就想到用读书时的笨方法,把自己感兴趣的文章段子摘抄下来,然后用自己的话翻译出来,在翻译的过程中去认识陌生词汇,达到克服英语阅读障碍症的目的。

希望和我一样害怕阅读英语文档的同学可以一起加油干掉这个 issue 啊;

本系列的原文是 Electron 文档,它们的中文文档还有欠缺,所以刚好就边学边翻译好了,万一以后能成为官网翻译呢,谁知道呢。

今天学习了一个词挺不错的: Nothing succeeds like success -- 一胜百胜

Introduction 介绍

Welcome to the Electron documentation! If this is your first time developing an Electron app, read through this Getting Started section to get familiar with the basics. Otherwise, feel free to explore our guides and API documentation.

欢迎来到 Electron 文档!如果你是第一次创建 Electron 应用,通读 Getting Started 这部分来属性基础知识。另外,放轻松来学习索引和 API 文档。

What is Electron? Electron 是什么

  • framework: A framework is a structure that forms a support or frame for something
  • embed: If an object embeds itself in a substance or thing, it becomes fixed there firmly and deeply.

A Electron is a framework for building desktop applications using JavaScript, HTML, and CSS. By embedding Chromium and Node.js into its binary, Electron allows you to maintain one JavaScript codebase and create cross-platform app that work on Windows, macOS, and Linux -- no native development experience required.

Electron 是一个使用 JavaScript, HTML, CSS 构建桌面应用的框架。通过嵌入 Chromium 和 Node.js 到二进制中,Electron 允许你维护一个 JavaScript 库来创建一个跨平台的应用,这个应用工作在 Window, macOS 和 Linux 上 -- 你不需要原生创建经验

Prerequisites 前提

  • prerequisite: If one thing is a prerequisite for another, it must happen or exist before the other thing is possible.
  • acquaint: If you acquaint someone with something, you tell them about it so that they know it. If you acquaint yourself with something, you learn about it
  • brief overview: 简要概述

These docs operate under the assumption that the reader is familiar with both Node.js and general web development. If you need to get more comfortable with either of these areas, we recommend the following resources:

这些文件的运行是假设读者都一个熟悉 Node.js 和常规的 web 开发。如果你想要对这些领域有更多的了解, 我们建议学习下面的资源;

Moreover, you'll have a better time understanding how Electron works if you get acquainted with Chromium's process model. You can get a brief overview of Chrome architecture with the Chrome comic, which was released alongside Chrome's launch back in 2008. Although it's been over a decade since then, the core principle introduced in the comic remain helpful to understand Electron.

此外, 如果你开始了解 Chromiun 的进程模型,这正是学习 Electron 如何工作的好时机。 你可以通过 Chrome comic 获 Chrome 结构的简要概述, Chrome comic 追溯到 Chrome 2008年发布持续至今。尽管至今已经有 10 年了,但是描述 comic 的核心规则仍然可以帮助我们了解 Electron。

Running examples with Electron Fiddle 通过 Electron Fiddle 运行例子

  • integrate: If someone integrates into a social group, or is integrated into it, they behave in such a way that they become part of the group or are accepted into it.
  • tutorial[tjuːˈtɔːriəl]: 教程
  • browse: If you browse through a book or magazine, you look through it in a fairly casual way
  • stuck: if you are stuck with something that you do not want, you cannot get rid of it.

Electron Fiddle is a sandbox app written with Electron and supported by Electron's maintainers. We highly recommend installing it as a learning tool to experiment with Electron's APIs or to prototype features during development.

Electron Fiddle是 Electron 官方推荐的用 Electron 编写的沙箱应用。我们非常建议下载它,把它作为一个学习工具来学习 Electron 的 API 和创建过程中的原型特性。

Fiddle also integrates nicely with our documentation. When browsing through examples in our tutorials, you'll frequently see an open in Electron Fiddle button underneath a code block. If you have Fiddle installed, this button will open a fiddle.electronjs.org link that will automatically load the example into Fiddle, no copy-pasting required.

Fiddle 可以很好的与说明书结合起来。当浏览教程中的例子时,你会经常在代码块旁边看到 open in Electron Fiddle 的按钮。如果你已经下载 Fiddle, 这个按钮就会打开 fiddle.electronjs.org 链接,然后自动将例子加载到 Fiddle 去,不需要复制粘贴。

Getting help

Are you getting stuck anywhere? Here are a few links to places to look:

你是否在某个地方卡住了?下面是一些可以查找帮助的链接

  • If you need help with developing your app, our community Discord server is a great place to get advice from other Electron app developers.

如果你创建的应用需要帮助,我们的不同意见社区 是一个不错的地方,你可以从其他的 Electron 应用开发者中获取到建议。

  • If you suspect you're running into a bug with the electron package, please check the Github issue tracker to see if any existing issues match your problem. If not, feel free to fill out our report template and submit a new issue.

如果你认为自己卡在了 electon 包的 bug 中,请通过 github 的 issue 路径查找一下是否有能匹配你问题的 issue。如果没有,放轻松,然后根据我们给定的模板来填写并发送一个新的 issue。