Skip to content

Bug in the getModels call of the LanguageTranslator #655

@Ericus1

Description

@Ericus1

[Language Translator] getModels()

This is literally a copy/paste error.

public ServiceCall<List> getModels(final Boolean showDefault, final String source, final String target) {
final RequestBuilder requestBuilder = RequestBuilder.get(PATH_MODELS);

if ((source != null) && !source.isEmpty()) {
  requestBuilder.query(SOURCE, source);
}

if ((target != null) && !target.isEmpty()) {
  requestBuilder.query(TARGET, source);
}

......
}

What is clearly supposed to be "requestBuilder.query(TARGET, target);" is using the value from source again. This makes this method degenerate into never being able to find any models because you're always trying looking for a translation to and from the same language.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions