yalla-coop / cost-of-living-support

GNU General Public License v3.0
1 stars 0 forks source link

Sentry → Missing source or target language #299

Closed cemalokten closed 9 months ago

cemalokten commented 10 months ago

Further info image

Sentry link (may have expired): https://hyde-housing.sentry.io/issues/4570398547/?project=4504276397981696&query=is%3Aunresolved&referrer=issue-stream&statsPeriod=30d&stream_index=1


cemalokten commented 9 months ago

@RamyAlshurafa It appears there may be an issue with the API for translations being directly requested in the browser without the lng query. To address this, we could potentially add some default parameters to the translateText function:

const translateText = async ({
  text = '',
  sourceLang = 'en',
  targetLang = 'en',
}) => {
  if (!targetLang || !sourceLang) {
    throw new Error('The source or target language is missing');
  }
  const params = {
    SourceLanguageCode: sourceLang,
    TargetLanguageCode: targetLang,
    Text: text,
  };

However, this may not be a significant issue, since all requests from the user interface provide a language.

Let me know what you think.

RamyAlshurafa commented 9 months ago

Yeah thanks @cemalokten for that, i have added the lng = 'en' to all controllers.

cyberteenie commented 9 months ago

@RamyAlshurafa @cemalokten does that mean we can close this issue?