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

Keeping same source in all translation #42

Closed
item4 opened this Issue Dec 14, 2015 · 4 comments

Comments

Projects
None yet
4 participants
@item4
Contributor

item4 commented Dec 14, 2015

Some PR update only some lang translation.

I think all source source code must be same.

How do you think about building readme with some script and seperated translation files?

For example..

// en.js
{
util: {
title: "Utilities",
description: "",
contents: {
  isArray: { title: "isArray", description: "" }
}
...
}

and

// isArray.js
// jQuery
$.isArray(range);

// Native
Array.isArray(range);
@camsong

This comment has been minimized.

Member

camsong commented Dec 14, 2015

Nice idea to find a way to keep them sync automatically.
But this can be tough, firstly we should try to keep the docs easy maintain. Right now markdown is easy.

@item4 Your JS way are not easy enough, but still a good start, we should investigate on this further.

@item4

This comment has been minimized.

Contributor

item4 commented Dec 14, 2015

We can check diff by travis-ci.

First, grep source code part and get count of each source part. If they have some difference, it was broken.

How about this?

@idiotWu

This comment has been minimized.

Contributor

idiotWu commented Dec 15, 2015

How about keep code source in js files and using some directives to insert them? For example:

In markdown:

#### code example:
```javascript
{{include 'src/a.js'}}
```

In build tools:

source.replace(/\{{2}include (['"])([^\1]+)\1\}{2}/g, (match, quote, src) => fs.readFileSync(src).toString());

In my view this will also be helpful for further testing :)

@Chocanto

This comment has been minimized.

Contributor

Chocanto commented Jan 6, 2016

Some source code have comments that need to be translated. If you want to include them, it will not be possible to get internationalized comments (well... in reality, source code is a lot of time in English).

@camsong camsong closed this Aug 5, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment