Merge pull request #1983

72d113dd Amended software licenses for Portuguese and Spanish (Nano Akron)
54bcd260 Added Simplified Chinese electrum word list (Nano Akron)
This commit is contained in:
Riccardo Spagni 2017-04-24 10:49:24 +02:00
commit e53dd76a49
No known key found for this signature in database
GPG key ID: 55432DF31CCD4FCD
7 changed files with 1812 additions and 29 deletions

View file

@ -33,6 +33,7 @@ set(mnemonics_headers)
set(mnemonics_private_headers set(mnemonics_private_headers
electrum-words.h electrum-words.h
chinese_simplified.h
english.h english.h
dutch.h dutch.h
french.h french.h

File diff suppressed because it is too large Load diff

View file

@ -51,6 +51,7 @@
#include <boost/crc.hpp> #include <boost/crc.hpp>
#include <boost/algorithm/string/join.hpp> #include <boost/algorithm/string/join.hpp>
#include "chinese_simplified.h"
#include "english.h" #include "english.h"
#include "dutch.h" #include "dutch.h"
#include "french.h" #include "french.h"
@ -84,6 +85,7 @@ namespace
{ {
// If there's a new language added, add an instance of it here. // If there's a new language added, add an instance of it here.
std::vector<Language::Base*> language_instances({ std::vector<Language::Base*> language_instances({
Language::Singleton<Language::Chinese_Simplified>::instance(),
Language::Singleton<Language::English>::instance(), Language::Singleton<Language::English>::instance(),
Language::Singleton<Language::Dutch>::instance(), Language::Singleton<Language::Dutch>::instance(),
Language::Singleton<Language::French>::instance(), Language::Singleton<Language::French>::instance(),
@ -348,6 +350,10 @@ namespace crypto
{ {
language = Language::Singleton<Language::Russian>::instance(); language = Language::Singleton<Language::Russian>::instance();
} }
else if (language_name == "Chinese (Simplified)")
{
language = Language::Singleton<Language::Chinese_Simplified>::instance();
}
else else
{ {
return false; return false;
@ -393,6 +399,7 @@ namespace crypto
void get_language_list(std::vector<std::string> &languages) void get_language_list(std::vector<std::string> &languages)
{ {
std::vector<Language::Base*> language_instances({ std::vector<Language::Base*> language_instances({
Language::Singleton<Language::Chinese_Simplified>::instance(),
Language::Singleton<Language::English>::instance(), Language::Singleton<Language::English>::instance(),
Language::Singleton<Language::Dutch>::instance(), Language::Singleton<Language::Dutch>::instance(),
Language::Singleton<Language::French>::instance(), Language::Singleton<Language::French>::instance(),

View file

@ -1,23 +1,43 @@
// Word list originally created by dabura667 // Word list originally created by dabura667 and released under The MIT License (MIT)
// //
// Copyright (c) 2014-2017, The Monero Project // The MIT License (MIT)
// //
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
// Code surrounding the word list is Copyright (c) 2014-2017, The Monero Project
// All rights reserved. // All rights reserved.
// //
// Redistribution and use in source and binary forms, with or without modification, are // Redistribution and use in source and binary forms, with or without modification, are
// permitted provided that the following conditions are met: // permitted provided that the following conditions are met:
// //
// 1. Redistributions of source code must retain the above copyright notice, this list of // 1. Redistributions of source code must retain the above copyright notice, this list of
// conditions and the following disclaimer. // conditions and the following disclaimer.
// //
// 2. Redistributions in binary form must reproduce the above copyright notice, this list // 2. Redistributions in binary form must reproduce the above copyright notice, this list
// of conditions and the following disclaimer in the documentation and/or other // of conditions and the following disclaimer in the documentation and/or other
// materials provided with the distribution. // materials provided with the distribution.
// //
// 3. Neither the name of the copyright holder nor the names of its contributors may be // 3. Neither the name of the copyright holder nor the names of its contributors may be
// used to endorse or promote products derived from this software without specific // used to endorse or promote products derived from this software without specific
// prior written permission. // prior written permission.
// //
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL

View file

@ -1,21 +1,44 @@
// Copyright (c) 2014-2017, The Monero Project // Word list originally created by dabura667 and released under The MIT License (MIT)
// //
// The MIT License (MIT)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
// Code surrounding the word list is Copyright (c) 2014-2017, The Monero Project
//
// All rights reserved. // All rights reserved.
// //
// Redistribution and use in source and binary forms, with or without modification, are // Redistribution and use in source and binary forms, with or without modification, are
// permitted provided that the following conditions are met: // permitted provided that the following conditions are met:
// //
// 1. Redistributions of source code must retain the above copyright notice, this list of // 1. Redistributions of source code must retain the above copyright notice, this list of
// conditions and the following disclaimer. // conditions and the following disclaimer.
// //
// 2. Redistributions in binary form must reproduce the above copyright notice, this list // 2. Redistributions in binary form must reproduce the above copyright notice, this list
// of conditions and the following disclaimer in the documentation and/or other // of conditions and the following disclaimer in the documentation and/or other
// materials provided with the distribution. // materials provided with the distribution.
// //
// 3. Neither the name of the copyright holder nor the names of its contributors may be // 3. Neither the name of the copyright holder nor the names of its contributors may be
// used to endorse or promote products derived from this software without specific // used to endorse or promote products derived from this software without specific
// prior written permission. // prior written permission.
// //
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL

View file

@ -1,23 +1,44 @@
// Word list originally created as part of the Electrum project, Copyright (C) 2014 Thomas Voegtlin // Word list originally created by dabura667 and released under The MIT License (MIT)
// //
// Copyright (c) 2014-2017, The Monero Project // The MIT License (MIT)
// //
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
// Code surrounding the word list is Copyright (c) 2014-2017, The Monero Project
//
// All rights reserved. // All rights reserved.
// //
// Redistribution and use in source and binary forms, with or without modification, are // Redistribution and use in source and binary forms, with or without modification, are
// permitted provided that the following conditions are met: // permitted provided that the following conditions are met:
// //
// 1. Redistributions of source code must retain the above copyright notice, this list of // 1. Redistributions of source code must retain the above copyright notice, this list of
// conditions and the following disclaimer. // conditions and the following disclaimer.
// //
// 2. Redistributions in binary form must reproduce the above copyright notice, this list // 2. Redistributions in binary form must reproduce the above copyright notice, this list
// of conditions and the following disclaimer in the documentation and/or other // of conditions and the following disclaimer in the documentation and/or other
// materials provided with the distribution. // materials provided with the distribution.
// //
// 3. Neither the name of the copyright holder nor the names of its contributors may be // 3. Neither the name of the copyright holder nor the names of its contributors may be
// used to endorse or promote products derived from this software without specific // used to endorse or promote products derived from this software without specific
// prior written permission. // prior written permission.
// //
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
@ -1678,11 +1699,11 @@ namespace Language
"risa", "risa",
"ritmo", "ritmo",
"rito" "rito"
}), 4) }), 4)
{ {
populate_maps(ALLOW_SHORT_WORDS); populate_maps(ALLOW_SHORT_WORDS);
} }
}; };
} }
#endif #endif

View file

@ -34,6 +34,7 @@
#include <time.h> #include <time.h>
#include <iostream> #include <iostream>
#include <boost/algorithm/string.hpp> #include <boost/algorithm/string.hpp>
#include "mnemonics/chinese_simplified.h"
#include "mnemonics/english.h" #include "mnemonics/english.h"
#include "mnemonics/spanish.h" #include "mnemonics/spanish.h"
#include "mnemonics/portuguese.h" #include "mnemonics/portuguese.h"
@ -155,6 +156,7 @@ TEST(mnemonics, all_languages)
{ {
srand(time(NULL)); srand(time(NULL));
std::vector<Language::Base*> languages({ std::vector<Language::Base*> languages({
Language::Singleton<Language::Chinese_Simplified>::instance(),
Language::Singleton<Language::English>::instance(), Language::Singleton<Language::English>::instance(),
Language::Singleton<Language::Spanish>::instance(), Language::Singleton<Language::Spanish>::instance(),
Language::Singleton<Language::Portuguese>::instance(), Language::Singleton<Language::Portuguese>::instance(),
@ -163,7 +165,7 @@ TEST(mnemonics, all_languages)
Language::Singleton<Language::Italian>::instance(), Language::Singleton<Language::Italian>::instance(),
Language::Singleton<Language::Russian>::instance(), Language::Singleton<Language::Russian>::instance(),
Language::Singleton<Language::French>::instance(), Language::Singleton<Language::French>::instance(),
Language::Singleton<Language::Dutch>::instance(), Language::Singleton<Language::Dutch>::instance()
}); });
for (std::vector<Language::Base*>::iterator it = languages.begin(); it != languages.end(); it++) for (std::vector<Language::Base*>::iterator it = languages.begin(); it != languages.end(); it++)