Skip to content
Draft
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
Binary file modified docs/assets/screenshots/portal/apollo-news.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/assets/screenshots/portal/bbc.png
Binary file not shown.
Binary file removed docs/assets/screenshots/portal/heise.png
Binary file not shown.
Binary file added docs/assets/screenshots/portal/nypost.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assets/screenshots/portal/nytimes.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/assets/screenshots/portal/spiegel.png
Binary file not shown.
Binary file modified docs/assets/screenshots/portal/tagesschau.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
42 changes: 25 additions & 17 deletions docs/de/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,47 +2,55 @@

> :mega: **Hinweis:** Wir suchen einen [Sponsor](sponsors.md), um dieses Projekt in den USA zu hosten. :flag_us: :statue_of_liberty:

Der "News Deframer" ist ein sprachliches Analysetool, für alle Ihre präferierten Nachrichtenseiten. Mit Hilfe von LLMs analysiert es die Nachrichten Schlagzeilen. Die Anwendung besitzt zwei Verwendungsmöglichkeiten: einen **RSS-Feed-Proxy** und ein **Browser-Plugin**.
Der "News Deframer" ist ein sprachliches Analysetool, für alle Ihre präferierten Nachrichtenseiten. Mit Hilfe von LLMs analysiert es die Nachrichten Schlagzeilen..

## Video
> Ein Werbeblocker blockiert Werbung, die Sie nicht wollen. Der News Deframer neutralisiert die mentale Wirkung von Clickbait, indem er die Portalseite jedes großen Nachrichtennetzwerks durch neutrale Sprache ersetzt.

[![News Deframer Promo](https://img.youtube.com/vi/flORP9WqgSw/maxresdefault.jpg){ width="500" }](https://www.youtube.com/watch?v=flORP9WqgSw&vq=hd1080 "News Deframer Promo"){ .glightbox data-width="100%" data-height="100%" }
## Was wir tun

[:fontawesome-brands-youtube: Auf YouTube anschauen](https://www.youtube.com/watch?v=flORP9WqgSw){ target="_blank" }
- Wir [ersetzen](showcases/index.md) die Portalseite
- Jede Schlagzeile wird durch neutrale Sprache ersetzt (Vermeidung von Clickbait, Reizüberflutung, Überredung und Framing)
- Wir haben eine integrierte [Trendanalyse](trends/index.md) / Erkennung von Talking Points
- Wir können Nachrichten Portale vergleichen, z. B. "Tagesschau" mit der "Apollo News" oder Bild mit dem Bayrischen Rundfunk.
- Ein Klick und Sie erhalten den Originalartikel / die Original-Portalseite zurück.

## Wir ersetzen die Portalseite
| | |
| :---: | :---: |
| <img src="/assets/screenshots/portal/tagesschau.png" alt="Tagesschau" width="500"/>| <img src="/assets/screenshots/portal/apollo-news.png" alt="Apollo News" width="500"/> |

Check failure on line 19 in docs/de/index.md

View workflow job for this annotation

GitHub Actions / lint

Table column style

docs/de/index.md:19:86 MD060/table-column-style Table column style [Table pipe is missing space to the left for style "compact"] https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md060.md
| [Showcase: Tagesschau](showcases/tagesschau.md) | [Open Showcase: Apollo News](showcases/apollo-news.md) |

Ein Werbeblocker blockiert Werbung, die Sie nicht wollen. Der News Deframer neutralisiert die mentale Wirkung von Clickbait, indem er die Portalseite jedes großen Nachrichtennetzwerks durch neutrale Sprache ersetzt.
## Video

Ein Wert von 50% oder höher deutet auf signifikantes Framing durch Sprache hin. Mit anderen Worten: Sehr wahrscheinlich versucht ein geschulter Journalist Sie mit Worte zu manipulieren und die KI sagt wo und wie. Der Titel oder die Beschreibung sind Clickbait, Framing, Reizüberflutung oder dient einer Agenda.
[![News Deframer Promo](https://img.youtube.com/vi/flORP9WqgSw/maxresdefault.jpg){ width="500" }](https://www.youtube.com/watch?v=flORP9WqgSw&vq=hd1080 "News Deframer Promo"){ .glightbox data-width="100%" data-height="100%" }

| | |
| :---: | :---: |
| **Apollo News** | **Heise** |
| <img src="/assets/screenshots/portal/apollo-news.png" alt="Apollo News" width="500"/> | <img src="/assets/screenshots/portal/heise.png" alt="Heise" width="500"/> |
| **BBC** | **Tagesschau** |
| <img src="/assets/screenshots/portal/bbc.png" alt="BBC" width="500"/> | <img src="/assets/screenshots/portal/tagesschau.png" alt="Tagesschau" width="500"/> |
| **Spiegel** | **NY Times** |
| <img src="/assets/screenshots/portal/spiegel.png" alt="Spiegel" width="500"/> | <img src="/assets/screenshots/portal/nytimes.png" alt="NY Times" width="500"/> |
[:fontawesome-brands-youtube: Auf YouTube anschauen](https://www.youtube.com/watch?v=flORP9WqgSw){ target="_blank" }

## Was dieses Projekt ist und was nicht

- Es handelt sich **nicht** um einen Fake-News-Detektor! Es findet keine inhaltliche Überprüfung der Nachrichten statt.
- Dieses Projekt verwendet ein LLM, das als neutraler Journalist operiert, um Inhalte auf Voreingenommenheit zu prüfen und die Einhaltung neutraler Sprache zu analysieren.
- Wir verwenden offene [Prompts](https://github.com/deframer/news-deframer/blob/main/pkg/think/prompts) die auf jedem LLM ausgeführt werden können.

## Warum ist eine Sprachanalyse geboten und effektiv
## Sprachanalyse

Warum Sprachanalyse effektiv :

- Wir möchten dabei helfen, die emotionale Wirkung von Schlagzeilen zu vermindern.
- Desinformation und Spekulation beruhen oft auf "Dark Patterns, Clickbait und emotionalen Triggern".
- Autoren von Desinformation verwenden häufig verschleiernde, reißerische und vage Sprachmittel, um rechtliche Konsequenzen zu vermeiden, aber einen bestimmten Effekt beim Leser hervorzurufen.

**Hinweis**: Es kann zu falsch-positiven / falsch-negativen Ergebnissen kommen.
**WARNUNG**: Durch das LLM **wird** es zu falsch-positiven / falsch-negativen Ergebnissen kommen. Im schlimmsten Fall verpasst (aus versehen) guten Artikel oder ein Clickbait-Artikel rutscht durch.

## Installation

Richten Sie Ihre eigene [Instanz](https://github.com/deframer/news-deframer/blob/main/docs/SETUP.md){ target="_blank" } ein.

## Wie es funktioniert

News Deframer ist ein RSS-Feed-Proxy. Wir beziehen die Schlagzeilen aus dem [RSS](rss-feed.md) eines Portals.
Wir nehmen den Feed und ersetzen dessen Inhalt durch eine neutrale Schlagzeile. Die aktualisierten Daten werden auch für das **Browser-Plugin** verwendet, das
die Portalseite dieser Nachrichtenquelle ersetzt.

## Chrome Erweiterung

Installation der [Chrome Erweiterung](https://chromewebstore.google.com/detail/ffpibngfmnagagggbjpgjbmehhilfinp){ target="_blank" }.
Expand Down
8 changes: 4 additions & 4 deletions docs/de/screenshots/rss-feed.md → docs/de/rss-feed.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ Dieses Beispiel stammt aus dem Feed `https://rss.nytimes.com/services/xml/rss/ny

## Screenshots

Es wurde `freshrss` verwendet um die Screenshots zu erzeugen. Der "News Deframer" neutralisiert den Ton jedes Artikels und stellt sicher, dass er sich als objektive Nachricht liest.
Es wurde [freshrss](https://www.freshrss.org/){ target="_blank" } verwendet um die Screenshots zu erzeugen. Der "News Deframer" neutralisiert den Ton jedes Artikels und stellt sicher, dass er sich als objektive Nachricht liest.

| Aktualisiert | Original |
| Deframed | Original |
| :---: | :---: |
| <img src="/assets/screenshots/rss-feed/updated.jpg" alt="Aktualisiert" width="600"/> | <img src="/assets/screenshots/rss-feed/original.jpg" alt="Original" width="600"/> |
| <img src="/assets/screenshots/rss-feed/deframed.jpg" alt="Deframed" width="600"/> | <img src="/assets/screenshots/rss-feed/original.jpg" alt="Original" width="600"/> |

## Proxy XML-Feed

Die KI analysiert den Upstream-Inhalt, liefert eine Begründung für ihre Bewertung und führt notwendige Ersetzungen durch, um die Sprache zu entschärfen.
Die KI analysiert den Feed, liefert eine Begründung für ihre Bewertung und erzeugt eine neue Schlagzeile, um die Sprache zu entschärfen.

```xml
<item>
Expand Down
File renamed without changes.
10 changes: 4 additions & 6 deletions docs/de/screenshots/index.md → docs/de/showcases/index.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
# Screenshots
# Showcases

## Browser-Plugin

- [BBC](bbc.md)
- [Tagesschau](tagesschau.md)
- [Apollo News](apollo-news.md)

## RSS Feed

Expand All @@ -14,8 +12,8 @@
Die folgende Konfiguration wurde verwendet, um diese Beispiele zu erstellen:

- **Hardware**: Mac Mini M1 (16GB RAM), unter macOS Tahoe 26.2
- **Software**: [LM Studio](https://lmstudio.ai/) 0.3.39
- **Modell**: [meta-llama-3.1-8b-instruct](https://huggingface.co/lmstudio-community/Meta-Llama-3.1-8B-Instruct-GGUF)
- **Software**: [LM Studio](https://lmstudio.ai/) 0.4.2
- **Modell**: [ministral-3-3b](https://huggingface.co/lmstudio-community/Ministral-3-3B-Instruct-2512-GGUF)

Das System verwendet diese [Prompts](https://github.com/deframer/news-deframer/tree/main/pkg/think/prompts/).

Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions docs/de/trends/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Trends

Check failure on line 1 in docs/de/trends/index.md

View workflow job for this annotation

GitHub Actions / lint

Files should end with a single newline character

docs/de/trends/index.md:1:6 MD047/single-trailing-newline Files should end with a single newline character https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md047.md

Check failure on line 1 in docs/de/trends/index.md

View workflow job for this annotation

GitHub Actions / lint

First line in a file should be a top-level heading

docs/de/trends/index.md:1 MD041/first-line-heading/first-line-h1 First line in a file should be a top-level heading [Context: "Trends"] https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md041.md
42 changes: 25 additions & 17 deletions docs/en/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,47 +6,55 @@

> :mega: **Note:** We are looking for a [Sponsor](sponsors.md) to host this project in the US. :flag_us: :statue_of_liberty:

News Deframer will detect journalistic neutrality and framing in news articles. By leveraging Large Language Models (LLMs), it analyzes the news headlines. It can act as an **RSS Feed Proxy** or as a **browser plugin**.
News Deframer will detect journalistic neutrality and framing in news articles. By leveraging Large Language Models (LLMs), it analyzes the news headlines.

## Video
> An Ad-Blocker blocks ads you don't want. The News Deframer vaporizes the mental impact of clickbait by replacing the portal page of any major news network with neutral language.

[![News Deframer Promo](https://img.youtube.com/vi/japh9-H29qY/maxresdefault.jpg){ width="500" }](https://www.youtube.com/watch?v=japh9-H29qY&vq=hd1080 "News Deframer Promo"){ .glightbox data-width="100%" data-height="100%" }
## What we do

[:fontawesome-brands-youtube: Watch on YouTube](https://www.youtube.com/watch?v=japh9-H29qY){ target="_blank" }
- We [replace](showcases/index.md) the portal page
- Every Headline is replaced with neutral language (avoiding clickbait, hyper stimulus, persuasion and framing)
- We have build in [Trend Analysis](trends/index.md) / detection of talking points
- You can compare major networks e.g. "The New York Times" with the "New York Post" or CNN with Foxnews.
- One click and you get the original article / original portal page.

## We replace the portal page
| | |
| :---: | :---: |
| <img src="/assets/screenshots/portal/nytimes.png" alt="The New York Times" width="500"/>| <img src="/assets/screenshots/portal/nypost.png" alt="New York Post" width="500"/> |

Check failure on line 23 in docs/en/index.md

View workflow job for this annotation

GitHub Actions / lint

Table column style

docs/en/index.md:23:91 MD060/table-column-style Table column style [Table pipe is missing space to the left for style "compact"] https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md060.md
| [Open Showcase: The New York Times](showcases/nytimes.md) | [Open Showcase: New York Post](showcases/nypost.md) |

An Ad-Blocker blocks ads you don't want. The News Deframer vaporizes the mental impact of clickbait by replacing the portal page of any major news network with neutral language.
## Video

A score of 50% or higher suggests significant bias. In other words: A trained professional journalist is using words to mess with you and the AI will telly you where and how. The title or the description is clickbait, framing, hyper stimulus or pushing an agenda.
[![News Deframer Promo](https://img.youtube.com/vi/japh9-H29qY/maxresdefault.jpg){ width="500" }](https://www.youtube.com/watch?v=japh9-H29qY&vq=hd1080 "News Deframer Promo"){ .glightbox data-width="100%" data-height="100%" }

| | |
| :---: | :---: |
| **Apollo News** | **Heise** |
| <img src="/assets/screenshots/portal/apollo-news.png" alt="Apollo News" width="500"/> | <img src="/assets/screenshots/portal/heise.png" alt="Heise" width="500"/> |
| **BBC** | **Tagesschau** |
| <img src="/assets/screenshots/portal/bbc.png" alt="BBC" width="500"/> | <img src="/assets/screenshots/portal/tagesschau.png" alt="Tagesschau" width="500"/> |
| **Spiegel** | **NY Times** |
| <img src="/assets/screenshots/portal/spiegel.png" alt="Spiegel" width="500"/> | <img src="/assets/screenshots/portal/nytimes.png" alt="NY Times" width="500"/> |
[:fontawesome-brands-youtube: Watch on YouTube](https://www.youtube.com/watch?v=japh9-H29qY){ target="_blank" }

## What this project is and is not

- This is **not** a fake news detector!
- This project uses an LLM acting as a neutral journalist to analyze content for bias and adherence to neutral language.
- We use open transparent [prompts](https://github.com/deframer/news-deframer/blob/main/pkg/think/prompts) that can be run on any LLM.

## Why is language analysis effective
## Language analysis

Why language analysis is effective

- We aim to help you avoid engaging with questionable headlines.
- Misinformation and speculation often rely on dark patterns, clickbait, and emotional triggers.
- Authors of misinformation often use disguise and vague language to avoid legal repercussions.

**WARNING**: We can have false positives / negatives.
**WARNING**: We **will** have false positives / negatives. Worst case - you don't read an article of your favorite news source or clickbait article slips through.

## Installation

Set up your own [instance](https://github.com/deframer/news-deframer/blob/main/docs/SETUP.md){ target="_blank" }.

## How it works.

Check failure on line 52 in docs/en/index.md

View workflow job for this annotation

GitHub Actions / lint

Trailing punctuation in heading

docs/en/index.md:52:16 MD026/no-trailing-punctuation Trailing punctuation in heading [Punctuation: '.'] https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md026.md

News deframer is basically a drop in replacement RSS Feed proxy. We get the headlines from the [RSS](rss-feed.md) of a portal.
We take the feed and replace it's content with a deframed version. The updated data is also used for the **browser plugin** that
replace the portal of this news source.

## Chrome Extension

Install the [Chrome Extension](https://chromewebstore.google.com/detail/ffpibngfmnagagggbjpgjbmehhilfinp){ target="_blank" }.
Expand Down
6 changes: 3 additions & 3 deletions docs/en/screenshots/rss-feed.md → docs/en/rss-feed.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ This example is derived from the `https://rss.nytimes.com/services/xml/rss/nyt/W

## Screenshots

The item is rendered by `freshrss`. Deframer neutralizes the tone of every article, ensuring it reads like objective news.
The item is rendered by [freshrss](https://www.freshrss.org/){ target="_blank" }. Deframer neutralizes the tone of every article, ensuring it reads like objective news.

| Updated | Original |
| Deframed | Original |
| :---: | :---: |
| <img src="/assets/screenshots/rss-feed/updated.jpg" alt="Updated" width="600"/> | <img src="/assets/screenshots/rss-feed/original.jpg" alt="Original" width="600"/> |
| <img src="/assets/screenshots/rss-feed/deframed.jpg" alt="Deframed" width="600"/> | <img src="/assets/screenshots/rss-feed/original.jpg" alt="Original" width="600"/> |

## Proxy XML Feed

Expand Down
File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions docs/en/screenshots/index.md → docs/en/showcases/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

## Browser Plugin

- [BBC](bbc.md)
- [Tagesschau](tagesschau.md)
- [The New York Times](nytimes.md)
- [New York Post](nypost.md)

## RSS Feed

Expand All @@ -14,8 +14,8 @@
The following setup was used to generate these examples:

- **Hardware**: Mac Mini M1 (16GB RAM), running macOS Tahoe 26.2
- **Software**: [LM Studio](https://lmstudio.ai/) 0.3.39
- **Model**: [meta-llama-3.1-8b-instruct](https://huggingface.co/lmstudio-community/Meta-Llama-3.1-8B-Instruct-GGUF)
- **Software**: [LM Studio](https://lmstudio.ai/) 0.4.2
- **Modell**: [ministral-3-3b](https://huggingface.co/lmstudio-community/Ministral-3-3B-Instruct-2512-GGUF)

The system utilizes these [Prompts](https://github.com/deframer/news-deframer/tree/main/pkg/think/prompts/).

Expand Down
1 change: 1 addition & 0 deletions docs/en/showcases/nypost.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
wefwefwwef

Check failure on line 1 in docs/en/showcases/nypost.md

View workflow job for this annotation

GitHub Actions / lint

Files should end with a single newline character

docs/en/showcases/nypost.md:1:10 MD047/single-trailing-newline Files should end with a single newline character https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md047.md

Check failure on line 1 in docs/en/showcases/nypost.md

View workflow job for this annotation

GitHub Actions / lint

First line in a file should be a top-level heading

docs/en/showcases/nypost.md:1 MD041/first-line-heading/first-line-h1 First line in a file should be a top-level heading [Context: "wefwefwwef"] https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md041.md
1 change: 1 addition & 0 deletions docs/en/showcases/nytimes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
wfwefwef

Check failure on line 1 in docs/en/showcases/nytimes.md

View workflow job for this annotation

GitHub Actions / lint

Files should end with a single newline character

docs/en/showcases/nytimes.md:1:8 MD047/single-trailing-newline Files should end with a single newline character https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md047.md

Check failure on line 1 in docs/en/showcases/nytimes.md

View workflow job for this annotation

GitHub Actions / lint

First line in a file should be a top-level heading

docs/en/showcases/nytimes.md:1 MD041/first-line-heading/first-line-h1 First line in a file should be a top-level heading [Context: "wfwefwef"] https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md041.md
1 change: 1 addition & 0 deletions docs/en/trends/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Trends

Check failure on line 1 in docs/en/trends/index.md

View workflow job for this annotation

GitHub Actions / lint

First line in a file should be a top-level heading

docs/en/trends/index.md:1 MD041/first-line-heading/first-line-h1 First line in a file should be a top-level heading [Context: "Trends"] https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md041.md
8 changes: 6 additions & 2 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,10 @@ plugins:
build: true
nav:
- News Deframer: index.md
- Screenshots: screenshots/index.md
- Showcases: showcases/index.md
- Trends: trends/index.md
- Status: todo.md
- RSS Proxy: rss-feed.md
- Sponsors: sponsors.md
- Links: links.md
- License: license.md
Expand All @@ -55,8 +57,10 @@ plugins:
build: true
nav:
- News Deframer: index.md
- Screenshots: screenshots/index.md
- Showcases: showcases/index.md
- Trends: trends/index.md
- Status: todo.md
- RSS Proxy: rss-feed.md
- Sponsoren: sponsors.md
- Links: links.md
- Lizenz: license.md
Expand Down
28 changes: 14 additions & 14 deletions overrides/js/language-detect.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
(function() {
var langs = ['de'], def = 'en', p = location.pathname, s = localStorage;
var browser = (navigator.language || '').slice(0, 2);
(function () {
// var langs = ['de'], def = 'en', p = location.pathname, s = localStorage;
// var browser = (navigator.language || '').slice(0, 2);

for (var i = 0; i < langs.length; i++) {
if (p.indexOf('/' + langs[i] + '/') === 0) return s.setItem('lp', langs[i]);
}
// for (var i = 0; i < langs.length; i++) {
// if (p.indexOf('/' + langs[i] + '/') === 0) return s.setItem('lp', langs[i]);
// }

if (p === '/' || p === '/index.html') {
for (var i = 0; i < langs.length; i++) {
if (document.referrer.indexOf('/' + langs[i] + '/') !== -1) return s.setItem('lp', def);
}
// if (p === '/' || p === '/index.html') {
// for (var i = 0; i < langs.length; i++) {
// if (document.referrer.indexOf('/' + langs[i] + '/') !== -1) return s.setItem('lp', def);
// }

var target = s.getItem('lp');
if (!target && langs.indexOf(browser) !== -1) target = browser;
// var target = s.getItem('lp');
// if (!target && langs.indexOf(browser) !== -1) target = browser;

if (target && target !== def) location.href = '/' + target + '/';
}
// if (target && target !== def) location.href = '/' + target + '/';
// }
})();