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
2 changes: 1 addition & 1 deletion bot/admin/web/src/app/core-nlp/state.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export class StateService implements AuthListener {
}

static normalizeLocaleCode(code: string): string {
return code.split('_')[0];
return code ? code.split(/[-_]/)[0] : code;
}

constructor(private auth: AuthService, private settings: SettingsService) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,6 @@ class ConnectorRestClient(
locale: Locale,
query: ClientMessageRequest,
): Response<ClientMessageResponse> {
return getService(path).talk(locale, query).execute()
return getService(path).talk(locale.toLanguageTag(), query).execute()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import java.util.Locale
interface ConnectorRestService {
@POST("{locale}")
fun talk(
@Path("locale") locale: Locale,
@Path("locale") locale: String,
@Body request: ClientMessageRequest,
): Call<ClientMessageResponse>
}
2 changes: 1 addition & 1 deletion bot/connector-rest/src/main/kotlin/RestConnector.kt
Original file line number Diff line number Diff line change
Expand Up @@ -205,4 +205,4 @@ class RestConnector(
else -> getTargetConnector(targetConnectorType)?.toConnectorMessage(message)?.invoke(this) ?: emptyList()
}
}
}
}
Loading