-
Notifications
You must be signed in to change notification settings - Fork 478
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
4685 langtoggle #4841
Merged
Merged
4685 langtoggle #4841
Changes from all commits
Commits
Show all changes
44 commits
Select commit
Hold shift + click to select a range
66d4c65
adding french bundle resource
JayanthyChengan ce5c7d0
new terms added related to Github issue:4680
JayanthyChengan c186ef6
Latest French translation - Consolidation
mhvezina bac5516
Added UI Toggle button
JayanthyChengan 20f0a18
Merge pull request #1 from BibNumUMontreal/BundleProperties
JayanthyChengan 24c131e
Merge remote-tracking branch 'remotes/origin/BundleProperties' into 4…
JayanthyChengan cb0b33a
removed comments
JayanthyChengan 68c0403
Merge remote-tracking branch 'remotes/origin/develop' into 4685-UI-to…
JayanthyChengan f23b8d3
Cleaned up the new language dropdown in the navbar. [ref #4685]
mheppler cd90f29
Merge remote-tracking branch 'remotes/origin/develop' into BundleProp…
JayanthyChengan ec779c3
added ValidationMessages.properties
JayanthyChengan 3b50383
Translations fixes + new file ValidationMessages
mhvezina c9b6a98
Merge pull request #2 from BibNumUMontreal/BundleProperties_Test
JayanthyChengan ac24fc7
Merge remote-tracking branch 'remotes/origin/develop' into BundleProp…
JayanthyChengan 9cdeec3
Merge pull request #4 from scholarsportal/BundleProperties_Test
JayanthyChengan ebe75ba
corrected dataverse.nameIlllegalCharacters value
JayanthyChengan 337d73a
Revert "corrected dataverse.nameIlllegalCharacters value"
JayanthyChengan 9b392dd
corrected dataverse.nameIlllegalCharacters value
JayanthyChengan 4d66c21
Fixes to French translation
mhvezina 8fd25ec
Merge pull request #5 from BibNumUMontreal/4856_FrenchPropertyFiles
JayanthyChengan 40f5276
code cleanup
oscardssmith 2b67476
update docs
oscardssmith 3c3762b
fixed typos #4841
pdurbin db815aa
now it works
oscardssmith 4fa6636
Fixes for French translation (apostrophes escaping + hyphens to emdas…
mhvezina 02dc9ba
Fix for em dashes
mhvezina 9184e5e
Merge pull request #6 from BibNumUMontreal/4856_FrenchPropertyFiles
JayanthyChengan eeaac83
Merge remote-tracking branch 'remotes/origin/develop' into 4856_Frenc…
JayanthyChengan 0bbd7ed
correction contact => personne-ressource
mhvezina a9a6add
More French translations + fixes
mhvezina c534f8c
Merge pull request #7 from BibNumUMontreal/4856_FrenchPropertyFiles
JayanthyChengan d4884b6
Merge branch 'develop' into 4685-langtoggle
oscardssmith f6ee5f8
now it actually works (I think)
oscardssmith 051611a
Merge branch 'develop' into 4685-langtoggle
oscardssmith 31853e4
Apostrophes escaped
mhvezina 42c1bdb
Merge pull request #8 from BibNumUMontreal/4856_FrenchPropertyFiles
JayanthyChengan eceed4b
Revert "Apostrophes escaped"
JayanthyChengan cc24ba4
Merge pull request #9 from scholarsportal/revert-8-4856_FrenchPropert…
JayanthyChengan 8ff4292
Merge remote-tracking branch 'remotes/origin/4856_FrenchPropertyFiles…
JayanthyChengan aa4a67c
Corrected FacesContext null instance
JayanthyChengan 0ea4771
added comment
JayanthyChengan c75aeb4
Merge pull request #4963 from scholarsportal/4685-langtoggle-SP
scolapasta 58e7a02
Merge branch 'develop' into 4685-langtoggle
sekmiller 7f892ba
#4685 remove extraneous @ignore
sekmiller File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
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
Large diffs are not rendered by default.
Oops, something went wrong.
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,49 @@ | ||
user.firstName=Veuillez entrer votre pr�nom. | ||
user.lastName=Veuillez entrer votre nom de famille. | ||
user.invalidEmail=Veuillez entrer une adresse courriel valide. | ||
user.enterUsername=Veuillez entrer un nom d'utilisateur. | ||
user.usernameLength=Le nom d'utilisateur doit comporter entre 2 et 60 caract�res. | ||
user.illegalCharacters=Caract�re(s) non valide(s) utilis�(s). Les caract�res valides sont a-Z, 0-9, '_', '-' et '.'. | ||
|
||
user.enterNickname=Veuillez entrer un pseudonyme. | ||
user.nicknameLength=Le pseudonyme ne peut exc�der 30 caract�res. | ||
user.nicknameNotnumber=Le pseudonyme ne devrait pas �tre un nombre | ||
|
||
dataset.templatename=Veuillez ajouter un nom pour le mod�le d'ensemble de donn�es. | ||
dataset.nameLength=Le nom ne peut exc�der 255 caract�res. | ||
|
||
dataverse.name=Veuillez entrer un nom. | ||
dataverse.alias=Veuillez entrer un alias. | ||
dataverse.aliasLength=L'alias ne peut exc�der 60 caract�res. | ||
dataverse.aliasNotnumber=L'alias ne devrait pas �tre un nombre. | ||
dataverse.nameIllegalCharacters=Caract�re(s) non valide(s) utilis�(s). Les caract�res valides sont a-Z, 0-9, '_', '-'. | ||
dataverse.category=Veuillez s�lectionner une cat�gorie pour votre dataverse. | ||
contenttype.slash=Le type de contenu doit contenir une barre oblique. | ||
setspec.notNumber=Le nom (Setspec) ne devrait pas �tre un nombre. | ||
setspec.maxLength=Le nom (Setspec) ne peut exc�der 30 caract�res. | ||
|
||
role.name=Un r�le doit avoir un nom. | ||
desc.maxLength=Le description ne peut exc�der 255 caract�res. | ||
alias.maxLength=L'alias ne peut exc�der 26 caract�res. | ||
alias.illegalCharacters=L'alias ne peut �tre vide. Les caract�res valides sont a-Z, 0-9, '_', '-'. | ||
|
||
custom.response=Veuillez entrer la r�ponse. | ||
custom.questiontext=Veuillez entrer le texte de la question. | ||
filename.illegalCharacters=Le nom du fichier ne peut contenir aucun des caract�res suivants\u00A0: \ / : * ? " < > | ; # . | ||
directoryname.illegalCharacters=Le nom du r�pertoire ne peut pas �tre suivi ni pr�c�d� d'un caract�re s�parateur de fichiers. | ||
filename.blank=Veuillez sp�cifier un nom de fichier. | ||
|
||
|
||
map.layername=Veuillez sp�cifier un nom de couche cartographique. | ||
map.layerlink=Veuillez sp�cifier un lien de couche cartographique. | ||
map.link=Veuillez sp�cifier un lien de carte int�gr�e. | ||
map.imagelink=Veuillez sp�cifier un lien d'image de carte. | ||
map.username=Veuillez sp�cifier un nom d'utilisateur WorldMap. | ||
|
||
oauth.username=Veuillez entrer votre nom d'utilisateur. | ||
|
||
password.retype=Le nouveau mot de passe est vide\u00A0: veuillez le retaper � nouveau. | ||
password.current=Veuillez entrer votre mot de passe actuel. | ||
password.validate=Page de r�initialisation du mot de passe par d�faut. | ||
|
||
guestbook.name=Saisir un nom pour le registre de visiteurs. |
116 changes: 116 additions & 0 deletions
116
src/main/java/edu/harvard/iq/dataverse/DataverseLocaleBean.java
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,116 @@ | ||
package edu.harvard.iq.dataverse; | ||
|
||
import edu.harvard.iq.dataverse.settings.SettingsServiceBean; | ||
import java.io.IOException; | ||
import java.io.Serializable; | ||
import java.util.*; | ||
import java.util.logging.Logger; | ||
|
||
import javax.faces.context.FacesContext; | ||
import javax.inject.Inject; | ||
import javax.inject.Named; | ||
import javax.servlet.http.HttpServletRequest; | ||
|
||
import org.json.*; | ||
|
||
@Named | ||
@javax.enterprise.context.SessionScoped | ||
public class DataverseLocaleBean implements Serializable { | ||
|
||
private static final Logger logger = Logger.getLogger(DataverseLocaleBean.class.getCanonicalName()); | ||
|
||
@Inject | ||
SettingsWrapper settingsWrapper; | ||
|
||
{ | ||
//Noticed that the NullPointerException was thrown from FacesContext.getCurrentInstance() while running the testcases(mvn:package). | ||
//Reason: the FacesContext is not initialized until the app starts. So, added the below if-condition | ||
if(FacesContext.getCurrentInstance() == null) | ||
{ | ||
localeCode = "en"; | ||
} | ||
else { | ||
if (FacesContext.getCurrentInstance().getViewRoot().getLocale().getLanguage() == "en_US") { | ||
localeCode = "en"; | ||
} else { | ||
localeCode = FacesContext.getCurrentInstance().getViewRoot().getLocale().getLanguage(); | ||
} | ||
} | ||
} | ||
|
||
// Map from locale to display name eg en -> English | ||
private Map<String, String> dataverseLocales; | ||
|
||
private String localeCode; | ||
|
||
public void init() { | ||
dataverseLocales = new LinkedHashMap<>(); | ||
try { | ||
JSONArray entries = new JSONArray(settingsWrapper.getValueForKey(SettingsServiceBean.Key.Languages, "[]")); | ||
for (Object obj : entries) { | ||
JSONObject entry = (JSONObject) obj; | ||
String locale = entry.getString("locale"); | ||
String title = entry.getString("title"); | ||
|
||
dataverseLocales.put(locale, title); | ||
} | ||
} catch (JSONException e) { | ||
// TODO Auto-generated catch block | ||
e.printStackTrace(); | ||
} | ||
//localeCode = dataverseLocales.keySet().iterator().next(); | ||
/*if (FacesContext.getCurrentInstance().getViewRoot().getLocale().getLanguage() == "en_US") { | ||
localeCode = "en"; | ||
} else { | ||
localeCode = FacesContext.getCurrentInstance().getViewRoot().getLocale().getLanguage(); | ||
}*/ | ||
} | ||
|
||
public Map<String, String> getDataverseLocales(){ | ||
return dataverseLocales; | ||
} | ||
|
||
public boolean useLocale() { | ||
if (dataverseLocales == null) { | ||
init(); | ||
} | ||
return dataverseLocales.size() > 1; | ||
} | ||
|
||
public String getLocaleCode() { | ||
if (localeCode == null) { | ||
init(); | ||
} | ||
return localeCode; | ||
} | ||
|
||
public void setLocaleCode(String localeCode) { | ||
this.localeCode = localeCode; | ||
} | ||
|
||
public String getLocaleTitle() { | ||
if (dataverseLocales == null) { | ||
init(); | ||
} | ||
return dataverseLocales.get(localeCode); | ||
} | ||
|
||
public void countryLocaleCodeChanged(String code) { | ||
if (dataverseLocales == null) { | ||
init(); | ||
} | ||
localeCode = code; | ||
FacesContext.getCurrentInstance() | ||
.getViewRoot().setLocale(new Locale(dataverseLocales.get(code))); | ||
try { | ||
String url = ((HttpServletRequest) FacesContext.getCurrentInstance() | ||
.getExternalContext().getRequest()).getHeader("referer"); | ||
FacesContext.getCurrentInstance().getExternalContext().redirect(url); | ||
|
||
} catch (IOException ioe) { | ||
ioe.printStackTrace(); | ||
} | ||
|
||
} | ||
|
||
} |
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
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
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This new
:Languages
setting needs to be documented. This is where we document them: http://guides.dataverse.org/en/4.9.1/installation/config.html#database-settings