<commit_before>from wagtailtinymce.rich_text import TinyMCERichTextArea


class CustomTinyMCERichTextArea(TinyMCERichTextArea):

    def __init__(self, attrs=None, **kwargs):
        super(CustomTinyMCERichTextArea, self).__init__(attrs)
        # NOTE: enable TinyMCE plugins in core/wagtail_hooks.py

        self.kwargs = {
			'buttons': [
				[
					 ['undo', 'redo'],
					 ['styleselect'],
					 ['bold', 'italic'],
					 ['forecolor', 'backcolor'],
					 ['alignleft', 'aligncenter', 'alignright', 'alignjustify'],
					 ['bullist', 'numlist', 'outdent', 'indent'],
					 ['table'],
					 ['link', 'unlink'],
					 ['wagtailimage', 'wagtailembed'],
					 ['pastetext', 'fullscreen'],
					 ['code']
				]
		    ],
			'height': '1000',
			'menus': False,
			'options': {
							'browser_spellcheck': True,
							'noneditable_leave_contenteditable': True,
							'language_load': True,
							'valid_elements': '*[*]',
							'extended_valid_elements':'script[language|type|src],div,table'
						},
			'valid_elements': '*[*]',
			'extended_valid_elements' :'script[language|type|src],div,table',
			'allow_unsafe_link_target': True,
		 }<commit_msg>translation._get_language is empty causing issues with tinymce.<commit_after>from wagtailtinymce.rich_text import TinyMCERichTextArea
from django.utils import translation
translation.activate('en')

class CustomTinyMCERichTextArea(TinyMCERichTextArea):

    def __init__(self, attrs=None, **kwargs):
        super(CustomTinyMCERichTextArea, self).__init__(attrs)
        # NOTE: enable TinyMCE plugins in core/wagtail_hooks.py
        self.kwargs = {
			'buttons': [
				[
					 ['undo', 'redo'],
					 ['styleselect'],
					 ['bold', 'italic'],
					 ['forecolor', 'backcolor'],
					 ['alignleft', 'aligncenter', 'alignright', 'alignjustify'],
					 ['bullist', 'numlist', 'outdent', 'indent'],
					 ['table'],
					 ['link', 'unlink'],
					 ['wagtailimage', 'wagtailembed'],
					 ['pastetext', 'fullscreen'],
					 ['code']
				]
		    ],
			'height': '1000',
			'menus': False,
			'options': {
							'browser_spellcheck': True,
							'noneditable_leave_contenteditable': True,
							'language_load': True,
							'valid_elements': '*[*]',
							'extended_valid_elements':'script[language|type|src],div,table',
							'language': 'en'
						},
			'valid_elements': '*[*]',
			'extended_valid_elements' :'script[language|type|src],div,table',
			'allow_unsafe_link_target': True,
		 }
{'fraction_non_alphanumeric': 0.17068191098407512, 'fraction_numerical': 0.0032666394446712946, 'mean_word_length': 3.6139359698681734, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3901079', 'n_tokens_mistral': 1043, 'n_tokens_neox': 776, 'n_words': 135}