Coder Social home page Coder Social logo

tristantheb / history-content Goto Github PK

View Code? Open in Web Editor NEW
4.0 1.0 1.0 673 KB

Script to check the latest page changes manually between the desired language and the original language.

Home Page: https://tristantheb.github.io/history-content/

License: Mozilla Public License 2.0

CSS 0.42% HTML 53.48% JavaScript 46.09%
mdn history page l10n web documantation

history-content's Introduction

The MDN Change history reader

This script makes it possible to differentiate between two text files containing the latest modifications of two distinct folders in order to indicate the absence of a page or an update of the pages.

Recovering data

  1. In order to generate a file, you need to open a Bash command block, and use the following command to retrieve the information from the mdn/content repository:

    git ls-tree -r --name-only HEAD files/en-us/ | grep ".md$" | while read filename; do
      echo "$(git log -1 --format="%ad" -- $filename) $filename" >> logs-en-us.txt
    done

    Note: You must have the folder locally on your computer, be in content and run the command from the root content.

  2. Then you need to retrieve the data for the language you want to check. For example with the French folder :

    git ls-tree -r --name-only HEAD files/fr/ | grep ".md$" | while read filename; do
      echo "$(git log -1 --format="%ad" -- $filename) $filename" >> logs-fr.txt
    done

    Note: You must have the folder locally on your computer, be in translated-content and run the command from the root translated-content.

    Note 2: If you wish to change the language, you must change files/fr/ and logs-fr.txt to the code used on the MDN for your language.

  3. Place both log files in the history folder of history-content so that the script can process them.

Processing the data

Now let's set up the important part of the system, the language we are checking. In the index.js file, change the following line to the language you want to check:

const lang = 'fr';

Then you just have to launch the index.html page and wait for the result to be returned.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.