Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for internationalisation and localisation and French as a language #27

Merged
merged 22 commits into from
Dec 29, 2024

Conversation

amakarudze
Copy link
Collaborator

@amakarudze amakarudze commented Nov 21, 2024

Changes in this PR

  • Enable internationalisation and localisation
  • Add locale for French
  • Add Google-translated French to the homepage
  • Add dummy links for Sponsors functionality.

@amakarudze amakarudze marked this pull request as draft November 21, 2024 22:29
@amakarudze amakarudze marked this pull request as ready for review November 22, 2024 00:53
@amakarudze amakarudze requested a review from sheenarbw November 22, 2024 00:53
@amakarudze
Copy link
Collaborator Author

Hey @sheenarbw, you can review the Django parts, and I will have Ariane check my Google-translated French. Thanks.

@amakarudze amakarudze requested a review from Arya-AD November 22, 2024 13:44
@amakarudze
Copy link
Collaborator Author

@Arya-AD the translations are in locale/fr/LC_MESSAGES/django.po. I have done for the homepage html and the links.

@Arya-AD
Copy link
Collaborator

Arya-AD commented Nov 22, 2024

Ok, I'll review in few hours

Copy link
Collaborator

@Arya-AD Arya-AD left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @amakarudze the translations are globally well done. Thanks!

locale/fr/LC_MESSAGES/django.po Outdated Show resolved Hide resolved
locale/fr/LC_MESSAGES/django.po Outdated Show resolved Hide resolved
locale/fr/LC_MESSAGES/django.po Outdated Show resolved Hide resolved
locale/fr/LC_MESSAGES/django.po Outdated Show resolved Hide resolved
locale/fr/LC_MESSAGES/django.po Outdated Show resolved Hide resolved
locale/fr/LC_MESSAGES/django.po Outdated Show resolved Hide resolved
locale/fr/LC_MESSAGES/django.po Outdated Show resolved Hide resolved
locale/fr/LC_MESSAGES/django.po Outdated Show resolved Hide resolved
locale/fr/LC_MESSAGES/django.po Outdated Show resolved Hide resolved
locale/fr/LC_MESSAGES/django.po Outdated Show resolved Hide resolved
@amakarudze
Copy link
Collaborator Author

Hello @amakarudze the translations are globally well done. Thanks!

Thanks @Arya-AD. I have accepted your suggested changes.

Copy link
Collaborator

@Arya-AD Arya-AD left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect! Thanks @amakarudze

Copy link
Collaborator

@sheenarbw sheenarbw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Anna,

Good start but there are a few strange things happening in here.

website/header_menu_items.py Outdated Show resolved Hide resolved
core/settings_base.py Outdated Show resolved Hide resolved
<!-- <h2 class="text-5xl font-bold text-tz_flag_blue-600 mb-4">Arusha, Tanzania</h2>
<p class="text-3xl font-semibold text-gray-700 mb-2">11 - 16 August</p> -->

<p>We are in the early phases of planning the next DjangoCon Africa!</p>
<p>Follow our socials to stay up to date</p>
<p>{% translate "We are in the early phases of planning the next DjangoCon Africa!" %}</p>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When running the site, this isn't translated.

image

Some things are translated and other things are not.

Copy link
Collaborator Author

@amakarudze amakarudze Nov 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You must be running the English version. The way translations and localization work is that you need to open the URL for each locale. For English this is 127.0.0.1:8000/en/ and
Screenshot 2024-11-24 at 16 20 15

for French 127.0.0.1:8000/fr/.
Screenshot 2024-11-24 at 16 33 16

These are the only supported languages so far.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Look at the top right of the screenshot I sent.

Maybe I'm doing something wrong. I was only able to get part of the page translated to french when I tried to run it in french.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sheenarbw I am not sure what you're doing wrong, but you're not supposed to translate the page to French. You're supposed to use the French locale. That's how Django works, through locales and not translations.

The translations are done manually by people, which is why I needed @Arya-AD's help with the file locale/fr/LC_MESSAGES/django.po where the translations are for French.
Check https://docs.djangoproject.com/en/5.1/topics/i18n/translation/, and you'll see I have done what is humanly possible to enable internationalisation. For translations for all other pages, @Arya-AD would need to help us as they are done manually.

I also used French as the starting point because we already have a French-speaking person who did translations we couldn't use last year due to the setup of our website, which didn't allow it. I didn't pick Portuguese or Spanish or any other language because we don't have a person to translate the pages for us manually.

@amakarudze amakarudze requested a review from sheenarbw November 24, 2024 15:42
@Arya-AD Arya-AD closed this Dec 2, 2024
@Arya-AD Arya-AD reopened this Dec 2, 2024
core/settings_base.py Outdated Show resolved Hide resolved
@amakarudze amakarudze merged commit 0b62158 into djangocon:main Dec 29, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants