Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Tried to run Commons in different languages.
The 2 Commons variables are currently not translatable:
commons_anonymous_welcome_title
commons_anonymous_welcome_body
Comment | File | Size | Author |
---|---|---|---|
#10 | variable_translation.png | 77.75 KB | Devin Carlson |
#10 | translation_interface.png | 85.13 KB | Devin Carlson |
#10 | declare-variables-1917922-10.patch | 1.57 KB | Devin Carlson |
#4 | 1917922.commons_site_homepage.translate_default_variable_values.patch | 1.13 KB | jpontani |
Comments
Comment #1
slowflyer CreditAttribution: slowflyer commentedCurrently the variables seemed not to be used at all...
The text:
Welcome to our community
Share your thoughts, find answers to your questions.
Is hardcoded in a panel pane.
Comment #2
japerryCurrently commons only supports english, and we bypass the language selector upon install. For multilingual support, we would have to do a more indepth audit of the whole installer, which has lots of hardcoded english content.
Comment #3
slowflyer CreditAttribution: slowflyer commentedI think that's not an issue of the installer...
The installer can stay in english and produce an english version ...
But if yout start making Commons multilingual after installation, it should be easier to do...
f.e. writing the welcome text to a node instead of a non translatable panel pane, would make it more easy.
Comment #4
jpontani CreditAttribution: jpontani commentedAttached a patch that wraps the default values for variable_get in t().
Comment #5
slowflyer CreditAttribution: slowflyer commentedThe patch #4 seems not to solve the issue ...
Comment #6
jpontani CreditAttribution: jpontani commentedThe variables are used in the panels config, and are set upon installation.
Comment #7
ezra-g CreditAttribution: ezra-g commentedComment #8
ezra-g CreditAttribution: ezra-g commentedAs I revisit this issue it seems the ultimate solution would be for the homepage text to be a piece of featurized content with proper translation.
However, t() seems like an acceptable stopgap given our future plans to provide featurized content, such as demo text.
Comment #9
ezra-g CreditAttribution: ezra-g commentedComment #10
Devin Carlson CreditAttribution: Devin Carlson commentedVariable translation can be taken care of by declaring variables to the Variable module (a dependency of the Internationalization module).
The attached patch declares all of the Commons Site Homepage variables.
Comment #11
Devin Carlson CreditAttribution: Devin Carlson commentedTested #10 by setting up a simple English + French Commons site and attempting to translate the homepage text using variable translation.
Comment #12
Devin Carlson CreditAttribution: Devin Carlson commentedCommitted #10 to Commons Site Homepage 7.x-3.x.
http://drupalcode.org/project/commons_site_homepage.git/commit/d5233f1