-
Notifications
You must be signed in to change notification settings - Fork 153
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix the language picker by making sure 'next' is the right URL (#6780) allow authenticated users to hit the wagtail localize endpoints (#6778) * allow authenticated users to hit the wagtail localize endpoints Updated migrations (#6795) Enable pontoon integration for wagtail-localize (#6794) * add wagtail_localize_git * heroku ssh generation script rebase fixes Update settings.py Update settings.py Better 500 logging (#6836) * allow forced logging of stack traces to console for 500 errors * Update urls.py * Update urls.py blog fixes for the localize branch (#6840) * blog fixes for the localize branch * import * oh flake8, you joker Show locale in admin title (until a proper solution is released in Wagtail Core) (#6843) rebase fixes Redirect /pt to /pt-BR (#6854) only create the locale, rather than cloning all pages, when creating a synced locale (#6853) Campaign page translation fix (#6855) Permanent pt-BR redirect (#6856) Added localized URLs for every page through the FoundationMetadataPageMixin (#6849) * Added localized URLs for every page through the FoundationMetadataPageMixin * Cache sitemap * Localized sitemaps Make tests pass (#6872) * Flake8 * Sitemap.xml test fix Localization synching and creating management commands (#6866) * Localization synching and creating management commands * Don't lower strings; requires exact string matching now Allow banner pages to be further localized (#6876) Marked fields are sync or translatable (#6875) * Marked fields are sync or translatable * Oop * Flake8 * Add petition synchronized fields Co-authored-by: Théo Chevalier <theo.chevalier11@gmail.com> Fix makemessages command for Django >= 3.1 (#6907) Use localized wagtail-footnotes (#6913) Localize missing fields for YT pages (#6923) Translate article page titles (#6924) Translate What You Can Do title (#6925) address all acceptance criteria (#6930) rebase fixes update all homepage fragments to pull from localized content (#7067) * update all homepage fragments to pull from localized content * Update network-api/networkapi/wagtailpages/templates/wagtailpages/fragments/news_you_can_use.html Co-authored-by: Kalob Taulien <4743971+KalobTaulien@users.noreply.github.com> * Update network-api/networkapi/wagtailpages/templates/wagtailpages/fragments/spotlight_posts.html Co-authored-by: Kalob Taulien <4743971+KalobTaulien@users.noreply.github.com> Co-authored-by: Kalob Taulien <4743971+KalobTaulien@users.noreply.github.com> Fix all the localized properties (#7068) * update all homepage fragments to pull from localized content * Update network-api/networkapi/wagtailpages/templates/wagtailpages/fragments/news_you_can_use.html Co-authored-by: Kalob Taulien <4743971+KalobTaulien@users.noreply.github.com> * Update network-api/networkapi/wagtailpages/templates/wagtailpages/fragments/spotlight_posts.html Co-authored-by: Kalob Taulien <4743971+KalobTaulien@users.noreply.github.com> * rest of the localized updates... I think * forgot to save a file Co-authored-by: Kalob Taulien <4743971+KalobTaulien@users.noreply.github.com> Translatable PNI fields (#7075) Translate 3 more PNI fields (#7081) Localized limks in Related products section (#7125) Localize PNI categories & products (#7124) Translate Host controls field (#7123) regenerating requirements.txt . migration renames migration fixes Override translatable fields for PNI home (#7146) Localize title field on Default pages (#7147) Bump wagtail-localize to 1.0rc3 (#7176) Category snippet localization (#7183) * category-snippet-localization * well then * Update network-api/networkapi/wagtailpages/templatetags/localization.py * update based on Karl's advice * some WIP removals * show correct categories on product pages, and relocalize urls to point to use the correct locale * let's not cache-clear Restore product filtering per language (#7208) Fix category fallthrough (#7212) * make missing categories fall through to the EN version * small docs update * ??? * oops * data-name should stay English Moved consts inside of functions to prevent runtime/migration conflicts (#7215) * Moved consts inside of functions to prevent runtime/migration conflicts * That's better rebase and flakefix
- Loading branch information
Showing
88 changed files
with
2,523 additions
and
259 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Copy SSH private key to file, if set | ||
# This is used for talking to GitHub over an SSH connection | ||
if [ $WAGTAIL_LOCALIZE_PRIVATE_KEY ]; then | ||
echo "Generating SSH config" | ||
SSH_DIR=/app/.ssh | ||
|
||
mkdir -p $SSH_DIR | ||
chmod 700 $SSH_DIR | ||
|
||
echo $WAGTAIL_LOCALIZE_PRIVATE_KEY | base64 --decode > $SSH_DIR/id_rsa | ||
|
||
chmod 400 $SSH_DIR/id_rsa | ||
|
||
cat << EOF > $SSH_DIR/config | ||
StrictHostKeyChecking no | ||
EOF | ||
|
||
chmod 600 $SSH_DIR/config | ||
|
||
echo "Done!" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
network-api/networkapi/highlights/migrations/0005_auto_20210531_1735.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Generated by Django 3.1.11 on 2021-05-31 17:35 | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('wagtailcore', '0062_comment_models_and_pagesubscription'), | ||
('highlights', '0004_remove_highlight_image'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='highlight', | ||
name='locale', | ||
field=models.ForeignKey(editable=False, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='+', to='wagtailcore.locale'), | ||
), | ||
migrations.AddField( | ||
model_name='highlight', | ||
name='translation_key', | ||
field=models.UUIDField(editable=False, null=True), | ||
), | ||
] |
15 changes: 15 additions & 0 deletions
15
network-api/networkapi/highlights/migrations/0006_bootstrap_migration.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Generated by Django 3.1.11 on 2021-05-31 17:18 | ||
|
||
from django.db import migrations | ||
from wagtail.core.models import BootstrapTranslatableModel | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('highlights', '0005_auto_20210531_1735'), | ||
] | ||
|
||
operations = [ | ||
BootstrapTranslatableModel('highlights.Highlight'), | ||
] |
31 changes: 31 additions & 0 deletions
31
network-api/networkapi/highlights/migrations/0007_localize_migration.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Generated by Django 3.1.11 on 2021-05-31 18:02 | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
import uuid | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('wagtailcore', '0062_comment_models_and_pagesubscription'), | ||
('highlights', '0006_bootstrap_migration'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name='highlight', | ||
name='locale', | ||
field=models.ForeignKey(default=1, editable=False, on_delete=django.db.models.deletion.PROTECT, related_name='+', to='wagtailcore.locale'), | ||
preserve_default=False, | ||
), | ||
migrations.AlterField( | ||
model_name='highlight', | ||
name='translation_key', | ||
field=models.UUIDField(default=uuid.uuid4, editable=False), | ||
), | ||
migrations.AlterUniqueTogether( | ||
name='highlight', | ||
unique_together={('translation_key', 'locale')}, | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
network-api/networkapi/management/commands/create_locales.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
from django.conf import settings | ||
from django.core.management.base import BaseCommand | ||
from wagtail.core.models import Locale | ||
|
||
|
||
class Command(BaseCommand): | ||
help = 'Look for and create locales if they do not exist. This can be run multiple times if needed.' | ||
|
||
def handle(self, *args, **options): | ||
for language_code, name in settings.WAGTAIL_CONTENT_LANGUAGES: | ||
locale, created = Locale.objects.get_or_create(language_code=language_code) | ||
if created: | ||
print(f"Create new locale: {name}") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
from django.conf import settings | ||
from django.core.management.base import BaseCommand | ||
from wagtail.core.models import Locale | ||
from wagtail_localize.models import LocaleSynchronization | ||
|
||
|
||
class Command(BaseCommand): | ||
help = 'Sync pages with original English pages' | ||
|
||
def handle(self, *args, **options): | ||
print("Select a language code to sync with English. ie: de") | ||
|
||
for language_code, name in settings.WAGTAIL_CONTENT_LANGUAGES: | ||
if language_code != 'en': | ||
print(f"{language_code} ({name})") | ||
|
||
language_code = input("Language code: ") | ||
|
||
# Confirm the language code is in the WAGTAIL_CONTENT_LANGUAGES | ||
language_codes_dict = dict(settings.WAGTAIL_CONTENT_LANGUAGES) | ||
if language_code not in language_codes_dict: | ||
print("Invalid language code") | ||
return | ||
|
||
print("Getting both locales...") | ||
english_locale, _ = Locale.objects.get_or_create(language_code='en') | ||
locale, _ = Locale.objects.get_or_create(language_code=language_code) | ||
|
||
print("Getting LocaleSynchronization object") | ||
sync, created = LocaleSynchronization.objects.get_or_create( | ||
locale=locale, | ||
sync_from=english_locale, | ||
) | ||
if created: | ||
print("\tNew LocaleSynchronization object created") | ||
|
||
print(f"Syncing {locale} from {english_locale}") | ||
sync.sync_trees() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
network-api/networkapi/news/migrations/0005_auto_20210531_1735.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Generated by Django 3.1.11 on 2021-05-31 17:35 | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('wagtailcore', '0062_comment_models_and_pagesubscription'), | ||
('news', '0004_remove_news_featured'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='news', | ||
name='locale', | ||
field=models.ForeignKey(editable=False, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='+', to='wagtailcore.locale'), | ||
), | ||
migrations.AddField( | ||
model_name='news', | ||
name='translation_key', | ||
field=models.UUIDField(editable=False, null=True), | ||
), | ||
] |
15 changes: 15 additions & 0 deletions
15
network-api/networkapi/news/migrations/0006_bootstrap_migration.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Generated by Django 3.1.11 on 2021-05-31 17:37 | ||
|
||
from django.db import migrations | ||
from wagtail.core.models import BootstrapTranslatableModel | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('news', '0005_auto_20210531_1735'), | ||
] | ||
|
||
operations = [ | ||
BootstrapTranslatableModel('news.News') | ||
] |
Oops, something went wrong.