Skip to content

German Language Support #125

Closed as not planned
Closed as not planned
@jokroese

Description

@jokroese

Initial checklist

Problem

I am supporting a colleague's project to build a browser plugin for encouraging gender-neutral language in German. I was really happy to find retext-equality and think it could be a brilliant base for some of the functionality.

I want to support my colleague in adding German language to retext-equality. (Some of the contributors won't be familiar with programming and I don't speak German.) I have seen that there are similar approaches to support retext-profanities (get-alex/alex#212). I also found a relevant issue here which ended with @wooorm refactoring the code to support multiple languages (#59). This is great!

I've started following the suggestions in #59 (comment) by adding a couple of basic rules and I am now trying to add the tests. I have a few questions about the best way to do this as it will form the template for both German and adding other languages.

Solution

  1. Should I follow the approach taken in retext-profanities and export retextEqualityDe from de.js?

  2. How should I set up tests?

I'm not super familiar with writing tests in Javascript but it looks simple enough. That said, I would like some support in creating a template for testing non-English language patterns in retext-equality.

The main reference I have found is that retext-profanities has the following test (https://github.com/retextjs/retext-profanities/blob/main/test.js#L35):

const fileFr = await retext().use(retextProfanitiesFrench).process('Merde!')

  assert.deepEqual(
    fileFr.messages.map(String),
    ['1:1-1:6: Don’t use `Merde`, it’s profane'],
    'should support other languages'
  )

This only runs for one test, whereas in retext-equality there are many tests for English.

Could someone give me an example of how a good template for the non-English tests would look?

Alternatives

I could intuitively push forward or not put in tests but I don't think either are good ideas!

Metadata

Metadata

Assignees

No one assigned

    Labels

    👀 no/externalThis makes more sense somewhere else👎 phase/noPost cannot or will not be acted on

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions